![]() Lastly the TClientDataSet needs to be opened when the application runs. Rather than selecting an individual field for a grid we select the parent TBindScopeDB. In the biolife.xml file this is the Notes field.īinding a TStringGrid is slightly different. In the Object Inspector selectĪnd select the field for the TEdit to display/edit.Ī TMemo is bound the same way, selecting “Link to DB Field” from the LiveBindings property in the Object inspectorĪnd then selecting a BLOB field from the field list. Repeat this process for the TEdit control. In this example I’m displaying the Common_Name field. Select the field you wish to display in this label control. With the TLabel selected, in the Object Inspector select Now we link the binding engine to the database engine by the DataSource property of the TBindScopeDB. Now we need to start binding these standard controls to the database fields.ĭrop a TBindingsList anywhere onto your form.įollow it with a TBindScopeDB, also anywhere on your form. Next drop onto the form one of each of these standard controls Note that it isn’t TDBGrid or any other TDB style of component. Now we start placing components on the form. I’m using the biolife.xml file from the Delphi XE2 samples directory. If you used a TClientDataSet you’ll need to specify an XML data file for it to load. ![]() Drop a TClientDataSet (or any other TDataSet descendent) and a TDataSource on the form just as you would in a VCL application.Ĭonnect the TDataSource to the TClientDataSet by it’s DataSet property, exactly as you do with a VCL application. Now we need a database for our application to access. There is much more to LiveBindings, but for today we’ll look at this most simplest of use cases, displaying and editing a database table in a FireMonkey application.įirstly we need to create a new FireMonkey HD Application by selecting FireMonkey however has no data-aware controls, instead LiveBindings allow you to bind database fields to standard controls. At its most basic level LiveBindings is the mechanism provided for FireMonkey applications to display and edit data from a database on screen, a job that in the VCL is traditionally done with data-aware controls. #DELPHI FMX GRID SERIES#This is the start of an in-depth series on the new LiveBindings technology found in Delphi XE2. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |