How to set the RadGrid to Auto-resize the height to fit the page size?

8 posts, 1 answers
  1. LamKhoa
    LamKhoa avatar
    92 posts
    Member since:
    Jun 2011

    Posted 02 Aug 2011 Link to this post

    Some row take up to 3 or 4 lines (wrap), some row only take up to one line. I would like to know if RadGrid has feature to automatically resize the height to fit each page size?

    Thanks
  2. Answer
    Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 03 Aug 2011 Link to this post

    Hi Lamkhoa,

    If you want the RadGrid control to expand vertically, depending on the number of its rows, you can  use the following CSS rule:

    .MyGridClass .rgDataDiv
    {
    height : auto !important ;
    }

    "MyGridClass" is some custom CSS class to the RadGrid control, that you should set to prevent the CSS rule be applied to all RadGrid instances on the page / website.

    Greetings,
    Pavlina
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. LamKhoa
    LamKhoa avatar
    92 posts
    Member since:
    Jun 2011

    Posted 03 Aug 2011 Link to this post

    I got it. Thanks.
  5. Daniel Aquere
    Daniel Aquere avatar
    85 posts
    Member since:
    Mar 2011

    Posted 26 Nov 2011 Link to this post

    Hi Pavlina,

    Very good your suggestion.

    Please, how can I use UseStaticHeaders="true" together with your suggestion? I tried, but, doesn´t works.

    Thanks, best

    Daniel
  6. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 28 Nov 2011 Link to this post

    Hello Daniel Aquere,

    Please examine the help article below and let me know if it works for you:
    http://www.telerik.com/help/aspnet-ajax/grid-change-scroll-height-at-runtime.html

    Regards,
    Pavlina
    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
  7. Nadav
    Nadav avatar
    1 posts
    Member since:
    Feb 2013

    Posted 21 Apr 2013 Link to this post

    Pardon me, 
    There is no problem
  8. KidSysco
    KidSysco avatar
    10 posts
    Member since:
    Aug 2013

    Posted 29 May 2014 Link to this post

    I would like to know why this happens. I need to apply this fix only on some radgrids in order to get them to work in Chrome. Can we get some more info on this?
  9. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 03 Jun 2014 Link to this post

    Hi Ryan,

    When scrolling with static headers are enabled grid ScrollHeight property(the height of the control's scrollable area) is set to 300px by default. This fixed height does not allow the grid to auto resize, when the data can not fill the scroll height. However, you can use the client-side GridCreated event to check whether the table height is less than the value of the ClientSettings.Scrolling.ScrollHeight property, and if so, explicitly modify the scroll area height to match the height of the data items as shown in the following article:
    http://www.telerik.com/help/aspnet-ajax/grid-resize-grid-with-scrolling-when-less-data.html

    I hope this information helps to understand why this happens.

    Regards,
    Pavlina
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017