Invoking an user control which contains a radwindow and a telerik grid

2 posts, 0 answers
  1. Saniya
    Saniya avatar
    2 posts
    Member since:
    Feb 2012

    Posted 14 Feb 2012 Link to this post

    Hi,

    I have an web user control having a radwindow and a radgrid within it. I want to invoke this user control from multiple pages which means I want to show the popup(radwindow) from multiple pages. Could you please guide me how i cn achieve this. Now I am creating an instance of the user control in the calling form and finding the radwindow from the user control.But it is not finding the radwindow from the user control.It is giving null when I am trying to find the radwindow from the user control.

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

    Posted 14 Feb 2012 Link to this post

    Hello,

    Try the following code.
    ASPX:
    <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
    <uc1:panel1WebUserControl ID="WebUserControl1" runat="server" />
    C#:
    protected void Button1_Click(object sender, EventArgs e)
       {
          RadWindow RadWindow1=(RadWindow) WebUserControl1.FindControl("RadWindow1");//Accessing RadWindow from UserControl.
          RadWindow1.VisibleOnPageLoad = true;
       }
    ASCX:
    <telerik:RadWindowManager Behaviors="Close" ID="rwm" runat="server" >
      <Windows>
       <telerik:RadWindow ID="RadWindow1" Title="Save layout" runat="server"  NavigateUrl="~/radgrid/grid.aspx" Modal="true">
       </telerik:RadWindow>
      </Windows>
    </telerik:RadWindowManager>

    Thanks,
    Princy.
Back to Top