Makara
Makara

Reputation: 233

How to show the row index in row header in datagridview?

I am wondering in row in the datagridview, How can i show the row index in the row header ? Or you, guy, could guide me to the trick like i describe below.

thanks in advance

Upvotes: 2

Views: 7496

Answers (1)

Amen Ayach
Amen Ayach

Reputation: 4348

Each row header is HeaderCell after all so you can deal with it as DataGridViewCell:

For i = 0 To grd.RowCount - 1
    grd.Rows(i).HeaderCell.Value = CStr(i + 1)
Next

Upvotes: 3

Related Questions