Click here to Skip to main content
15,911,317 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, In a datatable depending on the condition i want to insert new rows in middle.
Posted
Updated 5-May-15 21:53pm
v2
Comments
Maciej Los 7-May-15 2:15am    
What you mean by saying you want to add "new row in middle"?

1 solution

I think you're looking for this method: DataRowCollection.InsertAt(..)[^]

E.g.
C#
myDataTable.Rows.InsertAt(newRow, index);
 
Share this answer
 
Comments
Member 11021189 7-May-15 3:13am    
Yes,you are correct,I used above statement to insert, but to find index of new datatable and again from and add more rows from that position is required. Anyway, my problem has solved.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900