在网格视图中有单选按钮然后如何在页面加载时保持它们启用fasle并在链接按钮上启用true,它存在于同一网格中 [英] in grid view having radio button then how to keep them enabled fasle on page load and enabled true on link buton which is present in same grid vie

查看:83
本文介绍了在网格视图中有单选按钮然后如何在页面加载时保持它们启用fasle并在链接按钮上启用true,它存在于同一网格中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在网格视图中有单选按钮,然后如何在页面加载时启用它们,并在链接按钮上启用true,该按钮存在于同一网格中

in grid view having radio button then how to keep them enabled fasle on page load and enabled true on link buton which is present in same grid vie

推荐答案

您好,



您可以在gridview rowdatabound事件中启用false。



Hi,

You can make enabled false in gridview rowdatabound event.

protected void grdUrgentItem_RowDataBound(object sender, GridViewRowEventArgs e)
   {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                 //make enable false
                 CheckBox chk = (CheckBox )e.Row.FindControl("chkid");
                 chk.Enabled = false;
            }
   }





你可以在gridview rowcommand事件中启用true。





you can make enable true in gridview rowcommand event.

protected void grdUrgentItem_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            //make enable true
            GridViewRow row = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);
                 CheckBox chk = (CheckBox )row.FindControl("chkid");
                 chk.Enabled = true;
        }







希望有所帮助。




Hope it helps.


这篇关于在网格视图中有单选按钮然后如何在页面加载时保持它们启用fasle并在链接按钮上启用true,它存在于同一网格中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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