Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't get data from joined tables in dataset when using a CollectionView in WPF

I have a dataset with two datatables in it, with the correct relations added. In the datatable Inventory I have a field with a userId that is connected to the DataTable People.

I use a BindingListCollection for sorting and filtering.

this.ita.Fill(this.DsInventory._Inventory);
this.ata.Fill(this.DsInventory.People);
this.cv = new BindingListCollectionView(this.DsInventory._Inventory.DefaultView);
this.DataContext = this.cv; 

The problem now is: how can I bind the Name column from the People dataTable to to the form I have? This Name column is not in the CollectionView

like image 908
AKG Avatar asked Dec 28 '25 23:12

AKG


1 Answers

Name isn't in your DefaultView because the DefaultView you're using is for _Inventory so change the DefaultView or create a new one on the dataset to include the peoples table.

like image 156
Dustin Davis Avatar answered Dec 30 '25 11:12

Dustin Davis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!