There is a command to delete rows in datatable Delete();
But that is just deleting it is not shifting up the following rows like vector or arraylist.
For eg, there are 3 rows in data table.
Row 1, Data 1
Row 2, Data 2
Row 3, Data 3.
IF i delete Row 2, it will be like
Row 1, Data 1
Row 2, RowStatus = Deleted
Row 3, Data 3
How can I move up Row 3 to Row 2???
I have a way but it is not the correct one.
My one is create a new datatable, clone it and move every row to that table by checking the row status for each row. Then clear the actual datatable, and copy back all the data from temporary datatable.
There must be a better way.. anyone??
You have to call AcceptChanges on the DataTable to commit the changes made. Doing this will remove the rows marked as Deleted. (Along with any other changes made to the DataTable)