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

EditFormSettings Modal not rendering the correct height on initial load

5 Answers 222 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tzvetan
Top achievements
Rank 1
Tzvetan asked on 04 Oct 2011, 12:07 AM

Hello,

We are experiencing a problem where the EditFormSettings modal popup is not being rendered the correct height. The contents of the form is a usercontrol that renders available actions based on the grid item you have chosen to edit. What seems to be happening is that the modal popup window's height is being rendered before the user control finishes its calculation of which actions to display. We have tried calculating the actions on the Init event but that doesn't seem to work.

This is only a problem on the first load of the page after your browser history has been cleared, or if you are visiting the page for the first time.

Other things to note is that our actions and grid are separate user controls. I have attached a screenshot of what the problem looks like.

Thank you,

Tzvetan Devnaliev

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 04 Oct 2011, 11:46 AM
Hello Tzvetan,

Try the following CSS to make the EditFormSettings modal popup to render at correct height.
CSS:
<style type="text/css">
.RadGrid_Default .rgEditForm
{
 height:auto !important;
}
</style>

Thanks,
Princy.
0
Tzvetan
Top achievements
Rank 1
answered on 04 Oct 2011, 07:38 PM
Thank you for the quick response Princy, but that doesn't seem to solve the problem.

This is only reproducible on our faster environments, it happens on our windows 7 machines and the server, but not the XP machines. I am wondering if the modal popup is being painted too early because of the way the rendering engine works. We also have a loading panel that is in the modal but it is the correct height. The only problem is that the EditFormSettings popup is not the right size just the first load.

We are calculating which actions to display on the Init event of the user control when it really needs to be happening on the PreInit. The problem is that the PreInit event is not fired in a user control.

I currently see two ways we might be able to solve the problem. Move the action calculation to the Grid and set the height on the Item_Command event of the grid or somehow repaint the modal the first time it loads. If there are any other solutions or ideas it would be appreciated.

Thanks,

Tzvetan
0
Jon
Top achievements
Rank 1
answered on 04 Oct 2011, 07:46 PM
Additionally, this only occurs on the initial load of the modal popup.  After each subsequent load, the actions are displayed correctly. 
0
Galin
Telerik team
answered on 10 Oct 2011, 09:48 AM
Hi Jon,

To resolve the problem you are facing, I suggest that you try using the CSS code snippet below which will make the editform to resize with the content:
Copy Code
<style type="text/css">
       .RadGrid .rgEditForm > .rgHeader + div
       {
           height: auto !important;
       }
   </style>

Another option is to set FormStyle Height property to some static value that is enough to contain the contents:
Copy Code
<EditFormSettings InsertCaption="Add new item" EditFormType="Template">
               <FormStyle Height="300px" />
</EditFormSettings>

Additionally you can refer to this forum post.

I hope this helps.


Kind regards,
Galin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Jon
Top achievements
Rank 1
answered on 11 Oct 2011, 12:13 AM

THANK YOU.  This fixed it:

.RadGrid .rgEditForm

 

{

 

height: auto !important;

 

}

 

 

.RadGrid .rgEditForm > .rgHeader + div

 

{

 

height: auto !important;

 

}

Tags
Grid
Asked by
Tzvetan
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Tzvetan
Top achievements
Rank 1
Jon
Top achievements
Rank 1
Galin
Telerik team
Share this question
or