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

RadGrid height incorrect in initially hidden element.

7 Answers 138 Views
Grid
This is a migrated thread and some comments may be shown as answers.
david
Top achievements
Rank 1
david asked on 08 Jul 2008, 08:16 PM
I am adding a RadGrid to a Panel that is initially non visible (display=none). I am doing this because the grid is in a popup control that will be programatically displayed later.

The height of the grid is about 10 pixels. I see lots of forum posts about this issue that has been "fixed" in the last version. I guess it is fixed but not quite.

More info: the grid is in a panel that is the popup control for a PopupControlExtender. If the panel is visible at load, the contents flash on the screen before the extender hides it. So setting display=none avoids this flashing.

It is only the wrong size if the height is specified, and scolling is enabled. If scrolling is enabled without the height, the height is a little smaller than the height of the contents - causing both scroll bars to apprear. I have a test project read to go if you want me to open a ticket.

Thanks

7 Answers, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 09 Jul 2008, 02:43 PM
Hi David,

Have you tried setting RadGrid's width to 99% or even 99.9% ?

Regards,
Veli
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
david
Top achievements
Rank 1
answered on 09 Jul 2008, 05:07 PM
Hi Veli,

Yes I have tried several different settings of width and height, I have tried specifying the height on the ajaxpanel containing the grid, and I have tried making an extra div around and also inside the grid.
The width is correct, the problem is only with the height. If any height is specified, height="400" or height="80%" the height it set to about 10px.

Thanks
0
Iana Tsolova
Telerik team
answered on 10 Jul 2008, 12:46 PM
Hello david,

When you set the grid height in percentage, you need to insure that it's parent container's height is defined also. Otherwise the grid won't be able to calculate its height accurately.

Please find attached a sample project showning the suggested behavior.

Let us know if this helps.

Best wishes,
Iana
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Sandeep Verma
Top achievements
Rank 1
answered on 24 Jul 2008, 10:55 PM
We are also having the same exact problem... I have the Grid enclosed in a Div with a height and width set. But the MasterTableView part of the grid is showing only as 10px.

The Div which holds the Grid is inside an UpdatePanel which is inside a Panel which is being shown through a ModalPopupExtender.

I have also tried setting the Height to 100% and also tried 99.9% but to no avail.
0
Dimo
Telerik team
answered on 25 Jul 2008, 11:35 AM
Hi Sandeep,

Please always keep in mind that if a page element has height defined in percent, its parent must have height as well. This rule applies recursively, until an element with height defined in pixels is reached.

If you still have problems, please send us some sample code to look at.

Regards,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
david
Top achievements
Rank 1
answered on 25 Jul 2008, 12:39 PM
Hello Sandeep,

My problem came from the style="display: none". Try using style="visibility: hidden" instead.
I think when the display is set to none the engine does not give the control any size properties. Using visibility it does, but you then sometimes get some space left in the display area for your control that is now not visible. I get around this by defining all of my hidden panels right at the bottom of the page, where the blank space is less noticeable.

If this does not help, I did have another thread or ticket about another grid that was 10px in Firefox and there was a workaround supplied where you have to force the grid to repaint when the popup is shown. Let me know if the visibility thing does not work and I will go and find that other thread.

Hope this helps.
0
Sandeep Verma
Top achievements
Rank 1
answered on 25 Jul 2008, 05:58 PM
Hi David,

Thanks for your reply, i tried removing display:none in the Panel that holds the Grid but the effect became reverse of the original problem, instead of the Grid height showing up as 10px it is now showing up bigger than the actual height that I assigned.

Please show me that thread where you discussed that workaround which forces the grid to repaint.

Thanks
Tags
Grid
Asked by
david
Top achievements
Rank 1
Answers by
Veli
Telerik team
david
Top achievements
Rank 1
Iana Tsolova
Telerik team
Sandeep Verma
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or