RadGrid CheckBox应该被选中 [英] RadGrid CheckBox should be checked

查看:98
本文介绍了RadGrid CheckBox应该被选中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在应用程序中使用radgrid并显示emp详细信息,例如Emp_Code,Emp_Name,日期和状态.这里的状态是一个复选框.现在我正在选择SQL IT001,Jhon,01/02/2011,1(1为status).现在我想如果状态为1,那么应该在Radgrid中选中复选框.有人可以帮助我吗?我正在使用asp.net3.5和sql server2008.

Hi I am using radgrid in my application and display emp details such as Emp_Code, Emp_Name,Date and status. here status is a check box. now i am selecting in sql IT001, Jhon, 01/02/2011, 1(1 is status). now i want if status is 1 then checkbox should be checked in Radgrid.Can anyone help me? I am using asp.net3.5 and sql server2008.

推荐答案

一种方法是,在ItemDataBound事件中获取状态值. 如果状态为1,则检查状态,然后选中复选框,否则将其取消选中.
One way is, get the status value in your ItemDataBound event.
Check for the status if status is one then check the checkbox else uncheck it.


可以使用多种方法来实现.

第一名:
在查询本身中,根据条件传递带有所需值的标志.

第二名:
从数据库收到修改数据集,并为此复选框添加一个额外的字段.遍历表并为标志设置所​​需的值,然后将数据表与网格绑定.

第三名:
正如已经建议的那样,在引发每个行绑定的 grid Itemdatabound 事件中,检查该值并显式设置该复选框的值.
There can be ways to do it.

1st:
In the query itself, based on the condition pass on a flag with needed value.

2nd:
Modify the dataset once received from DB and accommodate an extra field for this checkbox. Loop through the table and set needed value for the flag and then bind the datatable with grid.

3rd:
As already suggested, in grids Itemdatabound event where every row binding is raised, check for the value and set the checkbox value explicitly.


这篇关于RadGrid CheckBox应该被选中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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