Is it possible to show row number in the row header of a DataGridView?
DataGridView
I\'m trying with this code, but it doesn\'t work:
pri
private void setRowNumber(DataGridView dgv) { foreach (DataGridViewRow row in dgv.Rows) { row.HeaderCell.Value = (row.Index + 1).ToString(); } }
This worked for me.