简体   繁体   English

当DatagridView中的Dependent列时,如何过滤数据,因为私有选择项消失了

[英]When Dependant column in DatagridView then how to filter the data because privious selected items are disappear

In my datagridview there are two dependent columns, one is category and the other is items. 在我的datagridview ,有两个相关的列,一个是类别,另一个是项目。 So I want to filter my item column list as per selected category. 所以我想按选定类别过滤我的项目列列表。

But the problem is that when I change the category wise data to datasource of items combobox, previous selected items names disappear because previous items is not in current datasource. 但是问题在于,当我将类别智能数据更改为项目组合框的数据源时,先前选择的项目名称会消失,因为先前的项目不在当前数据源中。

So what is correct solution of such problem. 那么该问题的正确解决方案是什么。

Filter columns with a Dataview: http://msdn.microsoft.com/en-us/library/system.data.dataview.aspx 使用数据视图过滤列: http : //msdn.microsoft.com/zh-cn/library/system.data.dataview.aspx

Depending on input validation and what not, you can update the DataSource after an edit operation. 根据输入验证和不验证输入,可以在编辑操作之后更新数据源。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM