GridView中BoundField的变量readonly属性 [英] variable readonly property of a BoundField ina gridview

查看:156
本文介绍了GridView中BoundField的变量readonly属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好.我的问题是我需要在某些情况下使某些字段为只读,而在其他相同的字段中设置为非只读.

Hello. my problem is i need in some cases make some fields read only and in other the same fields set not readonly. if someone could help me, I would be very grateful, thanks!

推荐答案




您可以尝试使用JavaScript.

Hi,


You can try with JavaScript.

function toggleEnable(oName){
var txtBox;
txtBox =document.getElementById(oName);
try
 {
   txtBox.readOnly = !txtBox.readOnly;
 }
 catch(e)
 {
    txtBox.readOnly=false;
 }}




快乐编码




Happy Coding


您可以使用 jQuery [
You could use jQuery[^] to toggle the fields, if you already assigned the textboxs (which require toggling) with a class.


(' .toggle:text' ).attr(' 只读',(
('.toggle:text').attr('readonly', (


这篇关于GridView中BoundField的变量readonly属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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