I am having an issue with a dropdownlist box in the datagrid that I need to hide or show. I can retrieve the element, but when I try to hide it, I encounter an error 'Unable to set property 'display' of undefined or null reference.' I have also attempted using visibility, but encountered a similar error. Can someone please provide guidance on how to achieve this? Thank you.
Here is my control:
<asp:dropdownList ID="dropID" runat="server" cssclass="selectColor w175 show"/>
The corresponding class in my style sheet:
.show {
display: normal;
}
.selectColor {
color: #333333; }
.w175 { width:175px; }
This is my JavaScript function:
function NeedChange(id) {
var dropID = document.getElementById(id);
if (dropID!=undefined ){
//dropID.style.visibility="hidden";
dropID.style.display='none';
}
}