如何在DatagridView中过滤行? [英] How do I filter row in DatagridView?

查看:795
本文介绍了如何在DatagridView中过滤行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我目前正在做论文项目,遇到很多问题.

我有2个DataGridView.一种是关于供应商表的信息,另一种是从供应商那里购买的所有商品的信息.
问题是当我单击DatagridView(供应商)中的任何一行时,可以说我单击了SupplierID=4的行,我的第二个数据DataGridView应该仅显示具有supplierID=4的已购买商品(仅用于过滤购买的商品).

Hi,

I currently doing my thesis project and I encounter a lot of problems.

I have 2 DataGridView''s. One is all about the supplier tables and the other is the information of all the item that been purchased from supplier.
The problem is when I click any of the row in DatagridView (Supplier), lets say I click row of SupplierID=4, my second data DataGridView should display only the purchased items having a supplierID=4 (to filter the only purchased item).

推荐答案

出了什么问题?在BindingSource
中使用过滤器(基于第一个DataGridView的选定行值)
BindingSource.Filter属性 [
What''s the problem? use the filter(Based on selected row value of 1st DataGridView) in your BindingSource

BindingSource.Filter Property[^]


这篇关于如何在DatagridView中过滤行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆