Live Chat Icon For mobile
Live Chat Icon

How do I make a field auto increment as new rows are added to my datagrid

Platform: WinForms| Category: Datagrid
	DataTable myTable = new DataTable('Customers');
	...
	DataColumn cCustID = new DataColumn('CustID', typeof(int));
	cCustID.AutoIncrement = true;
	cCustID.AutoIncrementSeed = 1;
	cCustID.AutoIncrementStep = 1;
     	myTable.Columns.Add(cCustID);

Share with

Share on twitter
Share on facebook
Share on linkedin

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.