从代码中使绑定域在Gridview中不可见 [英] Make Bound Fields Invisible in Gridview from Code

查看:89
本文介绍了从代码中使绑定域在Gridview中不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有带有手动给定的绑定字段和复选框列表的gridview.
我在复选框列表中的网格和列名称中显示员工表(名称,电子邮件,年龄,地址,薪水)数据

从复选框列表中,我仅选择名称"和电子邮件",然后单击提交",然后网格必须仅显示名称"和电子邮件"列数据,其余应不可见.我已经尝试过使用rowdatbound,其中我正在计算网格中的列数并进行检查,但是它不起作用.

任何建议将不胜感激.

Hi,

I have gridview with manually given bound fields, a checkbox list.
i am displaying employee table(Name,Email,Age,Address,Salary) data in grid and column names in checkbox list

from the checkbox list i select only Name and email and click on submit then the grid has to display only Name and Email columns data and remaining should be invisible. I have tried with rowdatbound wherein i am taking the count of columns in grid and checking but its not working.

any suggestions would be appreciated

推荐答案

好.....每个列表项都有一个值和一个text属性.
每个gridview列都有一个ID属性
如果值的名称类似于lstitem1,并且gridviewcolumn datafiield类似于colitem1,则您可以检查colItem1.Visible = lstItem1.Checked;.就这样
well.... each listitem has a value and and text property.
Each gridviewcolumn has a ID property
If the name of the value is like lstitem1 and the gridviewcolumn datafiield is like colitem1 you sould be able to check if colItem1.Visible = lstItem1.Checked; That''s all


这篇关于从代码中使绑定域在Gridview中不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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