BCGControlBar Library for .NET
DataIndex Property (GridColumn)




Gets or sets data index.
Syntax
'Declaration
 
Public Property DataIndex As Integer
'Usage
 
Dim instance As GridColumn
Dim value As Integer
 
instance.DataIndex = value
 
value = instance.DataIndex
public int DataIndex {get; set;}
public: __property int get_DataIndex();
public: __property void set_DataIndex( 
   int value
);
public:
property int DataIndex {
   int get();
   void set (    int value);
}
Remarks
Data index identifies the data displayed in a column. When you set a data index you actually define a scheme for your grid.
For example you need to display the following data structure in the grid:
{Name, Age, E-mail}
and you add appropriate columns to the Grid control.
Records represented by GridDataRow are collections of GridDataItem objects.
DataIndex specifies an index in this collection:

GridColumn colName = new GridColumn ();
colName.DataIndex = 0;

GridColumn colAge = new GridColumn ();
colAge.DataIndex = 1;

GridColumn colEmail = new GridColumn ();
colEmail.DataIndex = 2;

Now the order of columns in GridControl.ColumnCollection is not important, because the data for our columns can be retrieved using DataIndex.

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

GridColumn Class
GridColumn Members

Send Feedback