leathu raj

leathu raj

  • NA
  • 62
  • 79.4k

how to generate serial number in datagrid view row header

Apr 19 2014 7:40 AM
 hai,
       i have one doubt. I want to generate automatic serial number in datagrid view row header. If it possible please help me... And also i tried code for generate serial number  in rows cell value. It works fine but it automatically generate serial number to next one row also. please help me my code is here.
 
for (int i = 0; i < datagridView1.Rows.Count; i++)
{
datagridView1.Rows[i].Cells[0].Value = (i + 1).ToString();
}
 
 
thanks in advance... 

Answers (1)