User (Old forums)MemberJune 30, 2007 at 8:40 amPost count: 23064
We are trying to make a grid wrapper (custom control) which binds to a dataset with multiple tables.
The column bindings are specified in a field list (List collection).
private DataSet _datasource = new DataSet();
private List _fieldList;
private void getDataToXaml()
_fieldList = getFields() ……
_datasource = getData(_fieldList) ….. //tables based on the _fieldList
private void FillGridWithData()
foreach (Field field in _fieldList)
Binding bb = new Binding(field.Binding); //could be person.Name or person.City_Id or city.CityName
Column column = new Column();
column.DisplayMemberBinding = bb;
column.FieldName = field.Name;
column.Title = field.Caption;
//this works if we want to bind to only 1 table in the _dataset
//uxGrid.ItemsSource = Datasource.Tables.DefaultView;
//we want to bind to multiple tables in the dataset, with relation between them
uxGrid.DataContext = _datasource; //but this does not work
How do I bind to a dataset with multiple tables and where the row will display fields from the main table and the related tables?
Imported from legacy forums. Posted by Agnar (had 642 views)Xceed SupportMemberJuly 3, 2007 at 9:23 amPost count: 5658
If by “[binding] to a dataset with multiple tables and where the row will display fields from the main table and the related tables”, you mean to display master (main table) and details rows(relations) in the same grid, then that’s a scenario that is currently not supported.
While we have plans to implement such Hierarchical Master/Detail feature for the DataGrid for WPF, the exact timeframe is not availlable.
Imported from legacy forums. Posted by Marcus [Xceed] (had 207 views)User (Old forums)MemberJuly 4, 2007 at 9:21 amPost count: 23064
Thanks for your answer Marc.
Hierarchical Master/Detail feature for det datagrid will be welcome.
But that wasn’t what I meant.
I just want to show rows with columns from related tables in a dataset.
I could write a select query which combine these fields, but that is not desirable.
So, we have a form with a dataset populated with 3 or more tables with relations.
And one row in the grid will display for example “person.Name, person.City_Id, city.CityName” etc….
Is that possible in code behind, not in xaml?
Imported from legacy forums. Posted by Agnar (had 3197 views)
- You must be logged in to reply to this topic.