数据源,网格视图和下拉列表 [英] data source, grid view and drop down list

查看:89
本文介绍了数据源,网格视图和下拉列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我有一个使用DataSource连接到DB的网格视图.
数据源具有一个查询,该查询从数据库中选择具有特定ID的项目.

另外,我有一个DropDown-List,我想更新dataSource的查询,因此,当用户从DropDown-List中选择某个索引时,它将在Grid View中显示相关数据.
请帮忙!

Hello,

I have a Grid View that connected to DB with DataSource.
The DataSource have a query that selects items from the DB that have a specific ID.

also, I have a DropDown-List and I want to update the query of the dataSource so when the user selects some index from the DropDown-List it will show the relevant data in the Grid View .

Please Help!

Thanks.

推荐答案

使用BindingSource.Filter过滤您的dataGridView.

更改DropDownList_SelectedIndexChanged中的过滤器.
Use BindingSource.Filter to filter your dataGridView.

change the filter in DropDownList_SelectedIndexChanged.


这篇关于数据源,网格视图和下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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