I am using the DataGridControl to bind to a parent DataTable in a DataSet that has a DataRelation to a child table. I can bind the rows from the parent table just fine, but was wondering if there were some way to nest the child items in the grid.
Is there a way to specify that you want to create a new row for each bound item beneath the original row and bind its data separately?
Currenlty I’m looking at adding a StackPanel to the data template for each column and bind the child items beneath the main item. I’m forced to reuse the existing column layout but that’s not too much of a problem.
I don’t want to just group by the parent item although I may have to do so and just modify the group template.
Imported from legacy forums. Posted by Ron (had 1958 views)
[quote]”Is there a way to specify that you want to create a new row for each bound item beneath the original row and bind its data separately?”[/quote]
There is no built-in way to do that, but you should be able to do it pretty easilly by customizing the DataRow and/or DataCell templates.
I suggest you take a look at the CustomViews sample application, especially at the customTableViewDataRowTemplate resource in CustomTableView.xaml. This shows how to customize the DataRowTemplate to add custom stuff to the row.
Hope this helps!
Imported from legacy forums. Posted by Pascal (had 2140 views)