Hi,
Below JQuery is going to update two cells in UI show or hide:
<pre lang="xml">function DisplayExistingStatus() {
if($("#<%=IsNew.ClientID %>").val() == $("#<%=hfIsNew.ClientID %>").val()) {
$("#<%=tdLblECS.ClientID %>")[0].style.display = "";
$("#<%=tdECS.ClientID %>")[0].style.display = "";
ValidatorEnable($("#<%= rfvExistingCollStatus.ClientID %>")[0], true);
} else {
$("#<%=tdLblECS.ClientID %>")[0].style.display = "none";
$("#<%=tdECS.ClientID %>")[0].style.display = "none";
ValidatorEnable($("#<%= rfvExistingCollStatus.ClientID %>")[0], false);
}
}
And in page load events, do display/hide with the record which retrieve from DB:
if (this.IsNew.SelectedValue != ViewState["IsNew"].ToString())
{
this.tdECS.Attributes.Add("style", "display:none");
this.tdLblECS.Attributes.Add("style", "display:none");
this.rfvExistingCollStatus.Enabled = false;
}
In order to update one sub column to null when it was hide, I have written one check function:
if ((this.Master.FindControl("Content").FindControl("tdECS") as HtmlTableCell).Style.Value == "display:none")
collObj.ExistingCollStatus = null;
However, this style can not be updated when UI have been changed.
Wait for help