We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Need GDBG column to display dataset row number

Thread ID:

Created:

Updated:

Platform:

Replies:

4838 Jun 3,2003 10:14 PM Jun 4,2003 04:40 AM Windows Forms 1
loading
Tags: GridControl
Alex Fiedler
Asked On June 3, 2003 10:14 PM

Is there any way to display the row number of the dataset rows displayed, in a column of the grid?

Administrator [Syncfusion]
Replied On June 4, 2003 04: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
        End If
    End Sub
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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;