Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How can I insert row from a dataset into a selected row of data grid view which contains several rows.While inserting the single row in that selected row , my other rows should not be deleted.
Posted

1 solution

Basically you have two ways of filling a grid view.

1.
You add item per item (or row per row). In that case you manually control the grid and you're able to add/remove/update rows as you wish.
Look here[^] for starters.

2.
You set the DataSource (winforms) or DataContext (WPF) object. In that case you're not able to freely control the grid anymore. You'll need to pass through the object that set the DataSource/Context by or modifying it, or by setting it again (after a reload eg.).
DataContext[^]
DataSource[^]

Hope this helps.
 
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