3

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?

4

3 回答 3

1

RadWindow 客户端对象有一个center()方法,您可以像这样调用它:

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

查看在线文档以获取更多信息。

于 2012-12-12T23:03:34.540 回答
0

我认为您需要center()通过调用来“强制”应用show().

var oWnd = $find("<%= DialogWindow.ClientID %>");
oWnd.Center();
oWnd.Show();
于 2012-12-14T16:08:09.323 回答
0

确保您的AutoSizeBehaviors保留为Default。因此它会在自动调整大小后保持居中,将它们设置为其他值可能会导致左上角保持原位。

另外,尝试在 center() 周围添加超时:

setTimeout(function(){
oWnd.center();
}, 0);
于 2012-12-25T14:34:19.250 回答