本文介绍了使用下拉列表的数据网格过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好, 我想将下拉列表列保留在标题的模板字段中,并希望根据数据网格中标题列的下拉列表中选择的选项来过滤数据.但不是单行过滤, 它位于标题上,我需要在不使用数据源控件的情况下针对网格中的单个列过滤数据.
Hi all, I want to keep dropdown list column in the template field of a header and would like filter the data based on the options selected in the dropdown list of header column in the data grid..but not single row filtering, Its on the header where i need to filter the data with regard to a single column in the grid without using data source control.
推荐答案您好朋友 您需要此更改 1)在标题下拉菜单中设置autopostback属性= true 2)生成该下拉事件的SelectedIndexChanged事件 3)在这种情况下,您必须编写代码以过滤数据,然后将数据重新分配到网格以重新绑定它,并且输出将是网格数据,因为下拉菜单会更改索引 我希望这就是你想要的. 如果您满意,请不要忘记接受ans作为解决方案并对我的ans评分.. Hello friend you need this changes 1) set the autopostback property = true in header drop down 2) generate a SelectedIndexChanged event of that drop down event 3) in that event you have to write your code that will filter your data and that data will be reassign to your grid to re bind it and the out put is your grid data will be filtered as per your drop down will change the index i hope this is what you want..?? if you satisfied please don''t forgot to accept ans as solutions and also rate my ans..
更多推荐
使用下拉列表的数据网格过滤器
发布评论