Home Forums WPF controls Xceed DataGrid for WPF Master Detail Scenario

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #22390 |

    How can I have a master detail scenario using Xceed datagrid for WPF – e.g. two datagrids on the same window, one displaying Suppliers and the other one displaying products. So when the user selects a supplier row, I would want the products data grid to show only the products supplied by the current selected supplier.

    Imported from legacy forums. Posted by Shingi (had 2329 views)

    Xceed Support
    Member
    Post count: 5658

    If you are using a DataTable as a ItemsSource, it is pretty simple… All you need to do is to bind the second DataGridControl (the details grid) ItemsSource property to the first (master) DataGridControl’s “CurrentItem.<i>PutRelationNameHere</i>” PropertyPath.

    If you are not using a DataTable, it is slightly more complicated, you still need to bind the second DataGridControl to the “CurrentItem”. But this time, instead of specifying the relation in the PropertyPath, you need to place a converter on the binding that would fetch the appropriate data from your other source and return it.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 242 views)

    User (Old forums)
    Member
    Post count: 23064

    It worked. Thanks a lot.

    Imported from legacy forums. Posted by Shingi (had 3411 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.