Silverlight / WPF - add rows in wpf Datagrid - Asked By Mohamed on 18-Jan-11 09:24 AM

hi all,

 i want to add rows in wpf datagrid. top row of the grid i want to give the provision for adding new rows. can anyone
help to do this?

Anoop S replied to Mohamed on 18-Jan-11 09:58 AM
To programatically add a row:

DataGrid.Items.Add(new DataItem());

To programatically add a column:

DataGrid.Columns.Add(new DataGridTextColumn());

Check out this post on the WPF DataGrid discussion board for more information.