Hide RadComboBoxItem on server side and enable them on client side

2 posts, 1 answers
  1. Rajkumar Subramaniyam
    Rajkumar Subramaniyam avatar
    2 posts
    Member since:
    Apr 2010

    Posted 20 Sep 2010 Link to this post

    Hi,

    I need to hide the RadComboBoxItem on server side while binding it. But on client side i need to re-display them based on client side changes. I am able to set_visible(true) on client side. But when i set to visible = false on Server-Side, the comboBoxItem is not rendered.

    Is there any solution to do that?

    Thanks
    -- Raj
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 21 Sep 2010 Link to this post

    Hi Raj,


    Set the style "display:none;" instead of Visible proeprty of RadComboBoxItem from code behind.

    Here is the example:
    RadComboBox1.Items[0].Style.Add("display", "none");

    And in the Client code:
    function setVisibility() {
        var combo = $find("<%= RadComboBox1.ClientID %>");
        var item = combo.findItemByText("RadComboBoxItem1");
        item.get_element().style.display = "block";
    }


    Thanks,
    Princy.
Back to Top