I am using a DataGridView in my application that contains columns, one of them named ID.
I set the ID column to read only. My question is, if I want to add a new record to the DataGridView and the ID column automatically incrementing by 1, how do I do so?
I am using a DataGridView in my application that contains columns, one of them
Share
DataColumn, which is used in a DataTable, which is in turn displayed in a DataGridView, has properties for autonumbering.
Please see this cookbok:
http://www.c-sharpcorner.com/UploadFile/santowebster/AutonumberingDatatable12102008090717AM/AutonumberingDatatable.aspx
or if you want to switch to DataSets, this:
http://msdn.microsoft.com/en-us/library/yctw654b.aspx