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

[Solved] setting position of pop-up edit form?

1 Answer 356 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 28 Jul 2009, 02:39 PM
Is there any way to specify the initial position of a pop-up edit form?  The default "upper left hand corner of the grid" doesn't work well with the page layout I'm working on.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 29 Jul 2009, 06:47 AM
Hi Chris,

You can customize the default position of the PopUp edit form by hooking up the OnPopUpShowing client-side event of RadGrid and changing the location explicitly.

ASPX:
<ClientSettings>  
  <ClientEvents OnPopUpShowing="PopUpShowing" /> 
</ClientSettings> 

JavaScript:
 
<script type="text/javascript"
var popUp; 
function PopUpShowing(sender, eventArgs)  
{  
   popUp = eventArgs.get_popUp();  
   var gridWidth = sender.get_element().offsetWidth;  
   var gridHeight = sender.get_element().offsetHeight;  
   var popUpWidth = popUp.style.width.substr(0,popUp.style.width.indexOf("px"));  
   var popUpHeight = popUp.style.height.substr(0,popUp.style.height.indexOf("px"));  
   popUp.style.left = ((gridWidth - popUpWidth)/2 + sender.get_element().offsetLeft).toString() + "px";  
</script> 

You can also refer the following help article which explains more on this.
Center PopUp edit form in RadGrid

Shinu.
Tags
Grid
Asked by
Chris
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or