RadGrid height incorrect in initially hidden element.

8 posts, 0 answers
  1. david
    david avatar
    34 posts
    Member since:
    May 2008

    Posted 08 Jul 2008 Link to this post

    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
  2. Veli
    Admin
    Veli avatar
    2002 posts

    Posted 09 Jul 2008 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. david
    david avatar
    34 posts
    Member since:
    May 2008

    Posted 09 Jul 2008 Link to this post

    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
  5. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 10 Jul 2008 Link to this post

    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
  6. Sandeep Verma
    Sandeep Verma avatar
    2 posts
    Member since:
    May 2008

    Posted 24 Jul 2008 Link to this post

    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.
  7. Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 25 Jul 2008 Link to this post

    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.
  8. david
    david avatar
    34 posts
    Member since:
    May 2008

    Posted 25 Jul 2008 Link to this post

    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.
  9. Sandeep Verma
    Sandeep Verma avatar
    2 posts
    Member since:
    May 2008

    Posted 25 Jul 2008 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017