Syncfusion.Grid.Windows
Example 


PopulateHeaders Method (GridControl)

See GridModel.PopulateHeaders in the GridModel class for information.
Syntax
'Declaration
 
Public Sub PopulateHeaders( _
   ByVal range As GridRangeInfo, _
   ByVal dataSource As Object _
) 
'Usage
 
Dim instance As GridControl
Dim range As GridRangeInfo
Dim dataSource As Object
 
instance.PopulateHeaders(range, dataSource)
public void PopulateHeaders( 
   GridRangeInfo range,
   object dataSource
)

Parameters

range
dataSource
Example
This example shows how to populate the header values with the specified range and datasource. PopulateHeaders method.
// Populating DataSource
DataTable dataTable = new DataTable("Sample");
dataTable.Columns.Add("Column 1");
dataTable.Columns.Add("Column 2");
dataTable.Columns.Add("Column 3");
dataTable.Columns.Add("Column 4");
dataTable.Rows.Add("Row1", "Row2", "Row3", "Row4");
            
//Populating the headers
this.gridControl1.PopulateHeaders(GridRangeInfo.Cells(0, 1, 0, 4), dataTable);
' Populating DataSource
Dim dataTable As DataTable = New DataTable("Sample")
dataTable.Columns.Add("Column 1")
dataTable.Columns.Add("Column 2")
dataTable.Columns.Add("Column 3")
dataTable.Columns.Add("Column 4")
dataTable.Rows.Add("Row1", "Row2", "Row3", "Row4")
            
' Populating the headers
Me.gridControl1.PopulateHeaders(GridRangeInfo.Cells(0, 1, 0, 4), dataTable)
AssemblyVersion

Syncfusion.Grid.Windows: 17.3460.0.26

See Also