In this step, you'll learn how to bind a C1TrueDBGrid control to a DataSet. You will also learn about the basic True DBGrid properties and observe the run-time features of the grid. Complete the following steps to bind a C1TrueDBGrid control to a DataSet:
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Me.ComposerTableAdapter.Fill(Me.DsComposer.Composer) |
To write code in C#
C# |
Copy Code
|
---|---|
this.composerTableAdapter.Fill(this.DsComposer.Composer); |
Notice that the data from the Composers table is reflected in the grid:
True DBGrid retrieves the database schema information from the DataSet and automatically configures itself to display all of the fields contained in the database table. Note that the field names are used as the default column headings.
Congratulations, you have successfully completed binding a C1TrueDBGrid control to a DataSet. In the next section you will customize the C1TrueDBGrid control's appearance and behavior settings.