I have a DataTable with thousands of records, i want to show these records on per page basis ( i.e a DataGridView showing first 20 records and next button to show next 20 records ...)
To achieve this, i have added an Autoincrement Column to the DataTable so that i can use a filter on the Autoincrement Column to get the desired 20 records from the DataTable. I have used the following code
'dt' is the object of DataTable
When i set the datasource of DataGridView to this DataTable, i see null values in the Serial Column
Question is:
How can i get the Autoincrement Column working (with values)
I can't query the database, all i have to do is play around with the available DataTable
To achieve this, i have added an Autoincrement Column to the DataTable so that i can use a filter on the Autoincrement Column to get the desired 20 records from the DataTable. I have used the following code
Code:
Dim dc As New DataColumn("Serial",System.Type.GetType("System.Int32")) dc.AutoIncrement = True dc.AutoIncrementSeed = 1 dc.AutoIncrementStep = 1 dt.Columns.Add(dc)
When i set the datasource of DataGridView to this DataTable, i see null values in the Serial Column
Question is:
How can i get the Autoincrement Column working (with values)
I can't query the database, all i have to do is play around with the available DataTable
Comment