I just want to add a new row, I have my datasource in objects in which I need to do some processing. i need something like below for wpf datagrid...
DataRow row = dataTable.NewRow();
foreach (NavItem item in record.Items)
{
row[item.FieldNo.ToString()] = item.RecordValue;
}
dataTable.Rows.Add(row);
You should be using an ObservableCollection<NavItem> as the datagrid source. Then simply adding a new element to your collection will add it to the datagrid.
See this MSDN article.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With