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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Need GDBG column to display dataset row number

Thread ID:





4838 Jun 4,2003 02:14 AM UTC Jun 4,2003 08:40 AM UTC WinForms 1
Tags: GridControl
Alex Fiedler
Asked On June 4, 2003 02:14 AM UTC

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 08:40 AM UTC

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.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon