Click here to Skip to main content
15,888,330 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
Can Anybody help to add row to datagrid in WPf On click of any Button..
Posted
Comments
infosoftsaranya 16-Mar-12 7:25am    
reewt

1 solution

SQL
If you are using ADO.NET, then just create data row of the table dataRow = dt.newrow(); And do dt.row.add(dataRow); do not forget to do dt.acceptChanges(); .

As WPF binding works in both direction and each UI element update itself, so in this case once row will get added to datatable and if same is applied to grid then grid will get updated automatically.

summery.

1. you just need to add row in datatable.
 
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