Open RadWindow

2 posts, 0 answers
  1. Tina
    Tina avatar
    130 posts
    Member since:
    Jul 2011

    Posted 16 May 2012 Link to this post

    How to open RadWindow from server side based on selected item in combobox in SelectedIndexChanged event of combobox?
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 17 May 2012 Link to this post

    Hi Tina,

    Here is the sample code I tried to open RadWindow in SelectedIndexChanged event of RadComboBox.

    C#:
    protected void RadComboBox1_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
        {
           if(some condition)
                    {
                        string script = "function f(){$find(\"" + RadWindow1.ClientID + "\").show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "RadWindow", script,true); 
                    }
              else
                    {
                        string script = "function f(){$find(\"" + RadWindow2.ClientID + "\").show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "RadWindow", script, true); 
                    }
            }
        }

    Hope this helps.

    Thanks,
    Princy.
Back to Top