如何禁用复选框的文本字段?... [英] How do I disable text field of a checkbox?...

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

问题描述

如何禁用复选框的文本字段?...

How do I disable text field of a checkbox?...

推荐答案

您已绑定控件的文本以及值 - 只是很难 - 编码一些文本

例如 Text ='我是一个复选框'
You've bound the text of the control as well as the value - just hard-code some text
e.g. Text = 'I-am-a-checkbox'


你可以空白输出文本 GridView中的属性 RowDataBound 事件。

You can Blank out the Text Property inside the GridView RowDataBound Event.
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
        var chk = (CheckBox)e.Row.FindControl("ABCD");

        // Run some "if" condition here according to your business logic. If condition satisfied, then run the below line...
        chk.Text = string.Empty;
    }
}



如果你想用 jQuery 隐藏它,那么按照这里给出的技术 - [演示]如何在jQuery中隐藏asp.net复选框的文本? [ ^ ]


If you want to hide it using jQuery, then follow th technique given here - [Demo] How to hide the text of asp.net check box in jQuery ?[^]


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

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