How to Auto Height and/or max/min Grid height?

7 posts, 0 answers
  1. Rob Ainscough
    Rob Ainscough avatar
    262 posts
    Member since:
    Jan 2010

    Posted 18 Oct 2018 Link to this post

    I'm having NO LUCK trying to get a RadGrid to auto size it's height … here is what I'm trying to achieve (which seems simple to me) within RadPageLayout row:

    1.  Set Grid's min-height and max-height

    2.  Have the Grid auto size based on content and staying within the confines of min-Height and max-Height

    I've search for answers and see the question has come up very often but the solutions are incredibly worky and not reliable for a task that is very simple.  Is there an easy solution to this without having to write 100's of lines of code?

    I buy Telerik products to avoid having to write all this code, so I'm hoping this is a simple solution.

    Cheers, Rob.

     

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    4656 posts

    Posted 19 Oct 2018 Link to this post

    Hello Rob,

    I advise that you first examine the following article on setting the grid height in percent: https://www.telerik.com/support/code-library/setting-radgrid's-height-in-percents. Once you have the page layout set up so the grid container provides the grid size, you can set up the container to have the desired min and max dimensions as per your design requirements. 


    Regards,
    Marin Bratanov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Rob Ainscough
    Rob Ainscough avatar
    262 posts
    Member since:
    Jan 2010

    Posted 19 Oct 2018 in reply to Marin Bratanov Link to this post

    Hi Marin,

    Sorry but I'm not really seeing anything relevant in the link you provided?  It seems to be about RadAjaxPanel?  Or are you suggesting this is the only way and use of have a Grid's min-height and max-height will not work with a RadPageLayout?

    Cheers, Rob.

  4. Marin Bratanov
    Admin
    Marin Bratanov avatar
    4656 posts

    Posted 19 Oct 2018 Link to this post

    Hello Rob,

    RadPageLayout is designed to manage width and/or show/hide containers based on the total screen size. The height of an element is something the developer must set in their layout. This is why I advised that you start by making sure you can make the grid fill a generic container, like a <div> whose dimensions you can control (the article also talks about ajax settings to let you know how to AJAX-enable the grid, but the basics boil down to plain HTML + CSS). Once you can have the grid fill the desired container, you can place it in a RadPageLayout. Depending on its settings, that <div> will have some width or even be hidden, but the height is still something you'd have to set.


    Regards,
    Marin Bratanov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  5. Rob Ainscough
    Rob Ainscough avatar
    262 posts
    Member since:
    Jan 2010

    Posted 12 Feb in reply to Marin Bratanov Link to this post

    FYI, I was never able to resolve this issue using a RadPageLayout with LayoutRow.  I can set the Height="200" on RadGrid and the grid will be limited to a height of 200.

    I tried using those samples and AjaxManager but results were the same, when the grid populates ... in my 2 rows plus the header ... I still get a huge 'gap' between the last row and the grid border.  There doesn't appear to be any support for an "Resize" or "AutoSize" the height of the grid.

    I suppose I could manually try to calculate the row heights and header heights and then manually set the Grid's height, but that seems a bit "old school".  I was hoping for something in ClientSettings along the lines of the other Resizing options, but nothing exists.

    Rob

     

     

  6. Rob Ainscough
    Rob Ainscough avatar
    262 posts
    Member since:
    Jan 2010

    Posted 12 Feb in reply to Rob Ainscough Link to this post

    No sooner than I posted and I found the solution, it was simple also ...

    in the ClientSettings for the Grid ... in the Scrolling section simply add ScrollHeight="" 

    Rob

  7. Rob Ainscough
    Rob Ainscough avatar
    262 posts
    Member since:
    Jan 2010

    Posted 12 Feb in reply to Rob Ainscough Link to this post

    No sooner than I posted and I found the solution, it was simple also ...

    in the ClientSettings for the Grid ... in the Scrolling section simply add ScrollHeight="" 

    Rob

Back to Top