将下拉项目设为只读

问题描述:

HI,

i要求在datagrid中我有一个下拉项目ABC和Others

所以如果我点击其他下拉列表应该是只读的,文本框应该出现。



文本框出现但是下拉列表没有显示为readonly。这可能会使下拉列表成为readonly.please帮助。



谢谢

Srinivasa


i have a requirement that in datagrid i have a drop down with items "A" "B" "C" and "Others"
so if i click on Others dropdown should be readonly and textbox should appear.

textbox is appearing but dropdown is not appearing as readonly .is this possibe to make dropdown as readonly.please help.

Thanks
Srinivasa

你是如何制作文本的?框可见?如果使用javascript然后使用getElementById获取DropDown并通过设置disabled属性禁用它



执行如下操作:



How are you making the text box visible?? If using javascript then use the getElementById to get the DropDown and disable it by setting the disabled attribute

Do it as below:

document.getElementById(''<%= DropDownList1.ClientID %>'').disabled=false;







希望有所帮助:)




Hope it helps :)