Display auto number, serial number, row number in the data grid view is very simply; just you have to create one new column for the date grid, after created the new column make that column to read only. And enable Data Grid View VirtualMode property to True, and assign e.rowindex under CellValueNeeded events. see the step by step screens below. The CellValueNeeded events occurs when the VirtualMode property of the DataGridView control is true and the DataGridView requires a value for a cell in order to format and display the cell.
Step 1 : Create one new column for the Data Grid View and make that column to read only.
Step 2 : Enable Data Grid View VirtualMode property to True
Step 3 : Assign e.rowindex under CellValueNeeded events.
That’s it, after you completed all above 3 steps, run the program as-usual, you can see the auto number in the first column. Please post your comments and new ideas.