I currently have a RadGrid with an EditForm section where I am defining the layout of edit mode. The mode is being set to PopUp, so the editing is done in the pop-up windows.
However, the pop-up will move back to it's original position on a postback, since it contains dependent dropdowns and requires database queries. As I understand from other posts, this behavior can't really be fixed. Either way - I would like to lock the position of the edit pop-up to prevent movement and other behaviors as is done in a RadWindow with the "Behaviors" tag. Is this possible to do with the edit pop-up in a radgrid? I do not see an option that would allow this in the EditForm PopUpSettings tag.
Thanks,
James
7 Answers, 1 is accepted
Which EditMode do you use? Could you please wrap the entire form or just the postback controls within an RadAjaxPanel and let me know about the result?
Regards,
Eyup
Telerik
Hey Eyup,
The EditMode is set to "PopUp". The template is then defined in a "FormTemplate" inside of the "EditFormSettings" tag of the grid.
The pop-up is being generated by the grid, but the AJAX calls from the pop-up always move it back to the original position. Currently it is wrapped in an asp:Panel that is set as both an ajax control and the control it updates in a RadAjaxManagerProxy. Changing this setup to use a RadAjaxPanel results in the same issue.
Thanks,
James
In this case you will have to use a custom script to save the position of the PopUp container and re-apply it after the combo query to the database or any other postback.
For your convenience, I can prepare a sample RadGrid web site and send it to you if you prefer.
Regards,
Eyup
Telerik
Hey Eyup,
If you could provide a sample, that would be great. I am not sure how to access the pop-up container via JavaScript since it is generated by the grid.
Thanks,
James
I've created a sample RadGrid web site as you requested to demonstrate specifically you can achieve this requirement. Please run the attached application and let me know if it helps you.
Regards,
Eyup
Telerik
Thanks Eyup, this code does help keep the pop-up in it's position.
I had to modify the code to apply to the "rgEditForm" class instead of the "rgEditPopUp" class, since my Pop-up from the grid did not contain that class (it only contained rgEditForm).
Also, I noticed the setTimeout causes the pop-up to be visible briefly before being moved. Without this timeout, the pop-up moves slightly downwards after each postback. Do you know what causes this or why the timeout fixes the issue? It would be nice if the pop-up was not visible before being moved back to it's saved position.
Thanks,
James
The timeout is needed for the row to be fully created and prevent the behavior you observed when it is not set. Do not hesitate to let us know If other questions related to the provided code arise.
Regards,
Pavlina
Telerik