无法使用 rowfilter 过滤绑定到 Master-table 的 Detail-table?

Can't filter a Detail-table which is bound to a Master-table with rowfilter?

如果我想过滤细节 table(显示在 DataGrid 中),例如使用如下内容:DSHistory.TBL_MATERIAL.DefaultView.RowFilter = string.Format("MAT_NAME LIKE '%{0}%' AND MAT_FK_LFR_ID = {1}",TextBoxSearch.Text, ComboBoxLieferant.SelectedValue); 只有当我将 DataGrid 的 ItemsSource 显式更改为: dg1.ItemsSource = DSHistory.TBL_MATERIAL; 在事件中,但是绑定将不再起作用(在 page_loaded 中我添加了这样的 DataContext:this.DataContext = DSHistory.TBL_LIEFERANTENSTAMM; 并且当然绑定了 master- 和 detail-table 在 XAML 中:<ComboBox Name="ComboBoxLieferant" ItemsSource="{Binding}" DisplayMemberPath="LFR_NAME" IsSynchronizedWithCurrentItem="True" SelectionChanged="ComboBoxLieferant_SelectionChanged" /> <DataGrid Name="dg1" ItemsSource="{Binding Path=FK_TBL_MATERIAL_TBL_LIEFERANTENSTAMM}" IsSynchronizedWithCurrentItem="True">

有没有办法在没有 "breaking" 绑定的情况下像这样过滤?

感谢帮助!

我自己解决了这个问题。 我创建了一个过滤器 class,我在其中创建了一个 BindingListCollectionView。 然后我可以使用 customfilter 轻松过滤此视图。