RadGrid in web page has hyperlink command column, clicking the link to show a modal RadWindow by Javascript. The popup window needs to be shown in the center of current viewing window. However, if the RadGrid has more 50 rows, the page becomes large, browser shows the veritical scrollbar. Scrolling to the end of page and click on the last hyperlink to show RadWindow. Now, the browser moving to the top of the page and the popup window is shown on top, then browser is moving down to the bottom. You can only see the partial popup window, because its position is too high. How to display modal RadWindow right in the center of current viewing window instead of top center of page?
Here is the code snippet.
function OpenDetailWindow() { |
var oWin = $find("<%= DetailWindow.ClientID %>"); |
oWin.show(); |
} |
<telerik:RadWindow |
id="DetailWindow" |
runat="server" |
Modal="true" |
Width="780px" |
Height="580px" |
Skin="NonTrans" |
Behaviors="None" |
InitialBehaviors="None" |
VisibleStatusbar="false" |
VisibleTitlebar="false" |
ViewStateMode="Enabled" |
KeepInScreenBounds="true" |
EnableEmbeddedSkins="false" |
EnableEmbeddedBaseStylesheet="false"> |
<ContentTemplate> |
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" EnableAJAX="true"> |
<div class="transmodtop"> |
<p class="transmodhelpx"><a href="#"><img alt="Close" onclick="javascript:CloseDetailWindow();" src="../images/help_x.gif" /></a></p> |
</div> |
<div class="transmodbg"> |
<div class="transmodcontent"> |
<uc:TransactionDetail ID="transDetail" runat="server"></uc:TransactionDetail> |
<div class="transmodrule"></div> |
<div class="transmodbut"><asp:HyperLink ID="CloseDetailWinLink" runat="server" NavigateUrl="javascript:CloseDetailWindow();" CssClass="blu_button"></asp:HyperLink></div> |
</div> |
</div> |
</telerik:RadAjaxPanel> |
</ContentTemplate> |
</telerik:RadWindow> |