gridview中的禁用复选框 [英] disabled checkbox in gridview

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

问题描述

嗨我有4列gridview。第4列是checkbox.3rd是status.I想要禁用复选框,如果状态为no

Hi I have a gridview with 4 columns.4th column is checkbox.3rd is status.I want to disable the checkbox if status is no

推荐答案

CheckBox chk=new CheckBox();
chk = (CheckBox)grdAssign.Rows[i].FindControl("your checkbox column name");
chk.Enabled = false;


试试这个......:)< br $> b $ b

try this...:)

protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
   {
       if (e.Row.RowType == DataControlRowType.DataRow)

       {

           CheckBox chkBox= (CheckBox)e.Row.FindControl("chkbox1");

           if(e.Row.Cells[2].ToString()=="no")
                {

                    chkBox.Checked=false;

                }

       }

   }


这篇关于gridview中的禁用复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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