This is a migrated thread and some comments may be shown as answers.

Row Number In Row Header Column

4 Answers 308 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Imran
Top achievements
Rank 1
Imran asked on 11 Jul 2012, 05:11 PM
I need code in vb.net to show row number in the row header column of a gridview

4 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay
Telerik team
answered on 16 Jul 2012, 09:21 AM
Hi Imran,

In order to show row numbers in the row header, you should handle the ViewCellFormatting event and set the text of the row header cells to be equal to the RowIndex of the respective rows:

Private Sub radGridView1_ViewCellFormatting(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.CellFormattingEventArgs) Handles RadGridView1.ViewCellFormatting
    If TypeOf e.CellElement Is GridRowHeaderCellElement Then
        e.CellElement.Text = e.CellElement.RowIndex.ToString()
    End If
End Sub

I hope this helps.

Regards,
Nikolay
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Imran
Top achievements
Rank 1
answered on 17 Jul 2012, 09:35 AM
It worked.... thank you
0
Aseman
Top achievements
Rank 1
Veteran
answered on 02 Sep 2019, 06:14 AM

hi nikolay

thank you for your answer

but i`ve  another problem with this code

row index is reset per page in radgridview and this is not a good event

please help me

0
Nadya | Tech Support Engineer
Telerik team
answered on 03 Sep 2019, 11:23 AM
Hello Aseman,

Your question has already been answered in the other thread you have opened on the same topic. Please, see our answer there for more information.

We kindly ask you to use just one thread for a specific problem to contact us. Posting the same questions numerous times slows down our response time because we will need to review and address two or more tickets instead of one. Moreover, threads are handled according to license and time of posting, so if it is an urgent problem, we suggest you use a support ticket, which would be handled before a forum thread.

Thank you for your understanding. 

Regards,
Nadya
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
GridView
Asked by
Imran
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Imran
Top achievements
Rank 1
Aseman
Top achievements
Rank 1
Veteran
Nadya | Tech Support Engineer
Telerik team
Share this question
or