ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

C1DataColumn.DataField Property

Gets or sets the database field name for a column.

[Visual Basic]

Public Property DataField As String

[C#]

public string DataField {get;set;}

[Delphi]

public property DataField: String read get_DataField write set_DataField;

Remarks

The DataField property is used to bind a column to a particular field in the database table. If the specified field does not exist in the database table, binding does not occur, and the column will be blank at run time.

To specify an unbound column in a bound grid, the DataField property must be empty in order for the column data to be requested in the C1TrueDBGrid.UnboundColumnFetch event.

Example

The following code uses the DataField property to set the database field name for a column:

·      Visual Basic

       Me.C1TrueDBGrid1.Columns(0).DataField = "Name"

·      C#

       this.c1TrueDBGrid1.Columns[0].DataField = "Name";

·      Delphi

       Self.C1TrueDBGrid1.Columns[0].DataField := 'Name';

See Also

C1DataColumn Class | C1DataColumn Members | C1.Win.C1TrueDBGrid Namespace


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.