When we use datatable.newrow command, a new empty row added to bottom of rows. However I want newrow to added to top of datatable. How can I make it?
+7
A:
You use the NewRow to create a row with the same columns. To actually get it into the DataTable, you've got to do
myDataTable.Rows.InsertAt(0,myDataRow);
Where 0 is the index you want to insert it at.
Nick DeVore
2008-12-03 16:41:31
myDataTable.Rows.InsertAt(myDataRow,0); is the correct form. Thanks
mavera
2008-12-03 16:50:08