我有一个WPF DataGrid绑定到Entity Framework父EF对象内的对象集合.有点像:
<DataGrid ItemsSource="{Binding SelectedCustomer.Orders}" />
Run Code Online (Sandbox Code Playgroud)
现在,当我想"删除"订单时,我不想将其从数据源中删除,我只是想将其IsDeleted属性设置为true,以便保留数据.
我的问题是:DataGrid如果它的IsDeleted属性是真的,我怎么能让我跳过一行?我真的想使用绑定而不是代码隐藏.像这样的东西会很精彩:
<DataGrid ItemsSource="{Binding SelectedCustomer.Orders}" RowVisibilityPath="IsDeleted" />
Run Code Online (Sandbox Code Playgroud)
有点像DisplayMemberPath.我意识到我需要转换状态IsDeleted,但这是一个不同的主题.
有任何想法吗?