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

[Solved] using radwindow inside of an updatepanel

1 Answer 320 Views
Window
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 17 Jan 2008, 07:08 PM

I have an asp:linkbutton in my aspx page like such:

<

asp:LinkButton ID="lnbProjRole" runat="server" Text="make selections" ForeColor="Blue" Font-Bold="true"></asp:LinkButton>

My aspx page also contains a radwindowmanager:

<

telerik:RadWindowManager ID="Singleton" runat="server"></telerik:RadWindowManager>

I have an asp:updatepanel that surrounds the various elements of my page and fires asyncronously whenever any of the search elements on the page are changed.  When the linkbutton is clicked, an onclick server-side event fires that creates a radwindow.  Here's my codebehind (written in VB.NET):

Protected Sub lnbProjRole_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnbProjRole.Click

'Create a new window and add it dynamically

Dim newWindow As RadWindow = New RadWindow

newWindow.ID =

"RadWindow1"

newWindow.NavigateUrl =

"./Dialog.aspx"

newWindow.VisibleOnPageLoad =

True

newWindow.Enabled =

True

newWindow.Visible =

True

newWindow.Width = 250

newWindow.Height = 650

newWindow.Behaviors = WindowBehaviors.Close

newWindow.OffsetElementId =

"searchArea"

newWindow.ReloadOnShow =

True

newWindow.Modal =

True

'Add the newly created RadWindow to the RadWindowManager's collection

Singleton.Windows.Add(newWindow)

End Sub


Here's my problem:

When the radwindow opens, it looks like it only partially loads.  The nice styling around the window doesn't come through.  However, if I close the radwindow and then reload the parent page and then reopen the radwindow, the radwindow then looks perfect.  I'm thinking that the updatepanel (ajax) is not getting all of the content for some reason when it goes to open the radwindow.  I've even tried opening the window client-side and the same problem occurs.  Help!  I've been racking my brains on this for hours!  Thanks in advance for your help.  Do Telerik controls work OK within updatepanels?

Thanks,
Dave

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 21 Jan 2008, 09:18 AM
Hi Dave,

The reason for the problem comes from the fact that the RadWindow is loaded with a MS AJAX call. When you initially show the RadWindow on Page_Load, the control can get its skin from the server. When you open the RadWindow with Ajax however, there is no postback to the server, so the RadWindow cannot get its skin properly.
We have taken care of this case in RadAjax, but with MS AJAX you will need to manually insert the needed CSS files.
e.g. there are 2 solutions to the problem:
  1. Use "telerik:RadAjaxPanel" to wrap the content instead of the asp:updatepanel control
  2. Manually insert the CSS files for the corresponding skin in your page (the skins can be found in the RadControls Prometheus distribution, in the Skins folder and should be copied in your application)
    <link href="../Skins/Window.css" rel="stylesheet" type="text/css" /> 
    <link href="../Skins/Default/Window.Default.css" rel="stylesheet" type="text/css" /> 


I hope this helps.



Sincerely yours,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Window
Asked by
Dave
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or