Click here to Skip to main content
15,894,540 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
datagridview already contains 5 empty rows,i want to add new row at the position 0 and so on...


plzz,,,,,, AnyOne Can Help Me
Posted

Here[^]
 
Share this answer
 
Comments
Hasham Ahmad 8-Feb-13 12:06pm    
nice one richcb thumbsup to you :)
Richard C Bishop 8-Feb-13 12:07pm    
Thank you kindly.
C#
DataGridViewRow row = (DataGridViewRow)yourDataGridView.Rows[0].Clone();
row.Cells["Column2"].Value = "XYZ";
row.Cells["Column6"].Value = 50.2;
yourDataGridView.Rows.Add(row);



courtesy http://stackoverflow.com/questions/10063770/c-sharp-how-to-add-a-new-row-to-datagridview-programmatically[^]
 
Share this answer
 

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