I have a problem binding a DataSet with two tables related, I have been searching for many time. I am not sure how to do this with a WPF DataGrid (it seems to be different than with a WinForms DataGrid).
I am using MVVM pattern and have my DataContext associated with my DataSet, one grid is bound on ItemsSourceProperty to one of the tables. I am wondering how you select one item in dataGrid1 and automatically bind the related rows to dataGrid2.
all you need is to know your Relation Name. let us assume the tables are Student and Classes and the relation name is: FK_Student_Classes, then your binding looks like this:
when ever you select a row in the student grid you will see all related rows for in your classes grid.