TTMSFNCObjectInspector.DataSource Property
Gets or sets the data source whose fields are displayed by the inspector.
API unit family: TMSFNCObjectInspector
Declaring type: TTMSFNCObjectInspector
Type: TDataSource
Syntax
property DataSource: TDataSource;
__property Data::Db::TDataSource* DataSource = {read=FDataSource, write=SetDataSource};
Usage examples
Bind the object inspector to dataset fields
Assigns a datasource and hides fields that should not be editable.
procedure TForm1.FormCreate(Sender: TObject);
begin
TMSFNCObjectInspector1.DataSource := DataSource1;
end;
procedure TForm1.TMSFNCObjectInspector1ReadDBField(Sender: TObject;
AField: TField; var ACanRead: Boolean);
begin
ACanRead := AField.FieldName <> 'ID';
end;
void __fastcall TForm1::FormCreate(TObject *Sender)
{
TMSFNCObjectInspector1->DataSource = DataSource1;
}
void __fastcall TForm1::TMSFNCObjectInspector1ReadDBField(TObject *Sender,
TField *AField, bool &ACanRead)
{
ACanRead = AField->FieldName != "ID";
}