RAD Studio
ContentsIndex
PreviousUpNext
Displaying Field Component Values in Standard Controls

An application can access the value of a dataset column through the Value property of a field component. For example, the following OnDataChange event handler updates the text in a TEdit control because the value of the CustomersCompany field may have changed:

procedure TForm1.CustomersDataChange(Sender: TObject, Field: TField);
begin
  Edit3.Text := CustomersCompany.Value;
end;

 

void __fastcall TForm1::Table1DataChange(TObject *Sender, TField *Field)
{
  Edit3->Text = CustomersCompany->Value;
}

This method works well for string values, but may require additional programming to handle conversions for other data types. Fortunately, field components have built-in properties for handling conversions.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!