AD
Administrator
Syncfusion Team
December 12, 2002 09:56 PM UTC
Sean,
To hide columns in a GridListControl, you access the embedded GridControl property, GridListControl.Grid.
Dim grid As GridControl = Me.GridListControl1.Grid
grid.Cols.Hidden(3) = True ' hide col 3
To change the column headers takes more work if you want to do it in the GridListControl. You can change it by changing the ColumnName in the datatable with code such as:
Me.DataSet11.Products.ProductIDColumn.ColumnName = "zzzzzzz"
But if you want to change in from within the GridListControl, you currently have to handle the GridListControl.Grid.PrepareViewStyleInfo event and provide the header there.
'add the handler
Dim grid As GridControl = Me.GridListControl1.Grid
AddHandler grid.PrepareViewStyleInfo, AddressOf GridPrepareViewStyleInfo
'the handler
Private Sub GridPrepareViewStyleInfo(ByVal sender As Object, ByVal e As GridPrepareViewStyleInfoEventArgs)
If e.RowIndex = 0 And e.ColIndex = 2 Then
e.Style.Text = "MyCOl2Name"
End If
You can see an auto-complete GridListControl in a grid cell in the Quick Start/CellTypes sample that ships with the product. (Go to the bottom of the grid)