Tobias Tångfelt
Tobias Tångfelt

Reputation: 83

Telerik radwindow position

I´m having a problem with telerik RadWindow. In my application the following steps will happen:

  1. User clicks on a button, the RadWindow will be visible (in the center of the window). The user will then pick a file to upload.

  2. When the user press the upload button the RadWindow is still visible but now a DataTable with Data will also be visible in there. The telerik RadWindow is set to AutoSieze="true" so it can be extended when the DataTable being filled with data. But because of the new size the RadWindow is not in the middle anymore because of the bigger size.

I have tried to use the left and top properties to adjust the position but without any success. Is it possible to change the position of the radWindow either from Client or Server code? I also have tried moveTo(position) (JavaScript) but it´s not working.

Does anyone has similar problems?

Upvotes: 3

Views: 6971

Answers (3)

rdmptn
rdmptn

Reputation: 5611

Make sure your AutoSizeBehaviors are left to Default. Thus it will keep centered after autosizing, setting them to other values may have the effect that the top left corner stays in place.

Also, try adding a timeout around center():

setTimeout(function(){
oWnd.center();
}, 0);

Upvotes: 0

Francis P
Francis P

Reputation: 13665

I think you need to "force" the center() to apply by calling show().

var oWnd = $find("<%= DialogWindow.ClientID %>");
oWnd.Center();
oWnd.Show();

Upvotes: 0

M4N
M4N

Reputation: 96606

The RadWindow client-side object has a center() method, which you can call like this:

var oWnd = $find("<%= DialogWindow.ClientID %>");
oWnd.center();

Have a look at the online documentation for more information.

Upvotes: 1

Related Questions