1

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);

}
eoghanm
  • 11
  • 1

1 Answers1

0

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;
        }
    }
Jenda Matejicek
  • 151
  • 3
  • 14
  • Yes but then I can't set it to set_visible(true); again in the javascript for some reason – eoghanm Dec 16 '13 at 11:25
  • 3
    That's because when you set the combobox to ``Visible = false`` in code behind, it doesn't get registered with the DOM. I would either hide it via javascript, or set the style to ``display: none`` in code-behind rather than hiding it. – Mathew Collins Dec 16 '13 at 11:28