How do you keep a Rad Combo Box hidden after postback?

415 views Asked by At

I am having an issue with a Telerik Rad Combo Box in that I am setting it to invisible in the Javascript based on another Rad Combo Box index change event, but when I then click a button which causes a postback, the rad combo box becomes visible again. In the javascript onIndexChanged event of a different rad combo box I am hiding the two rad combo box's using the set_visible() property. But they do not remain invisible after a server side postback

function OnIndexChange(sender, args) {

    var radComboBox1 = $find("<%= RadComboBox1.ClientID %>");
    var radComboBox2 = $find("<%= RadComboBox2.ClientID %>");

    radComboBox1.set_visible(false);
    radComboBox2.set_visible(false);

}
1

There are 1 answers

2
Jenda Matejicek On

Did you tried to set the visibility accodring to "IsPostBack" property in the code behind?

    protected void Page_PreRender(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            radComboBox1.Visible = false;
            radComboBox2.Visible = false;
        }
    }