This is a migrated thread and some comments may be shown as answers.

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

1 Answer 45 Views
Window
This is a migrated thread and some comments may be shown as answers.
Saniya
Top achievements
Rank 1
Saniya asked on 14 Feb 2012, 06:48 AM
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.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 14 Feb 2012, 08:27 AM
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.
Tags
Window
Asked by
Saniya
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or