ADAdministrator Syncfusion Team June 4, 2003 03:40 AM
If you do not mind losing the record indicator (triangle marking the current row), you can just set a couple of properties to get these numbers shown.
Dim style As GridStyleInfo = Me.GridDataBoundGrid1.BaseStylesMap("Row Header").StyleInfo
style.CellType = "Header"
style.Font.Bold = False
Me.GridDataBoundGrid1.Model.Options.NumberedRowHeaders = True
If you want to see the numbers on the headers other than the current cell, and see the marker on the current row, then you can use the PrepareViewStyleInfo event for this.
Private Sub GridDataBoundGrid1_PrepareViewStyleInfo(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs) Handles GridDataBoundGrid1.PrepareViewStyleInfo
If e.ColIndex = 0 And e.RowIndex <> Me.GridDataBoundGrid1.CurrentCell.RowIndex Then
e.Style.CellType = "Header"
e.Style.Font.Bold = False
If you want to see both the numbers and the marker in the same cell, one way would be to set the properties as above, then handle the CellDrawn event (only in 1.6 or later), and in this event if it is the current row's header cell, just draw the triangle your self.