Can't Insert New Row Between Row and Row While Existing DataTable Looping

  • Thread starter Thread starter Kelvin
  • Start date Start date
K

Kelvin

Hi All,

While the existing datatable is looping, I can insert new row into
datatable, but I can't insert it between datarows. All new rows will
inserted into buttom row. Please advise!
 
HI Kelvin
If you want to insert in arbitrary locations within your datatable., you
need to create DataRowCollection of the rows of your datatable
DataRowCollection r = mytable.Rows;
There are the function RemoveAt and InsertAt of the DataRowCollection Class
You can read more about that object on this link

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemdatadatarowcollectionclasstopic.asp
hope this helps
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 
Back
Top