When only horizontal scroll is there a way to have height adapted to records count

5 posts, 0 answers
  1. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 18 Jan 2010 Link to this post

    Hello,

    My grid has many columns and few records, I use ClientSettings to enable Scrolling but it takes a fixed heigth not very nice when there are only one or 2 records.

    Is there a way to shrink the grid heigth to the lower value required by the number of rows ?
    Should be the min of max grid Height and height required to display actual rows.

    Thanks for help.
    CS
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 19 Jan 2010 Link to this post

    Hello CS,

    Go through the following help document which explains on how to reduce the size of the grid when the data does not fill the content area when scrolling is enabled. This should probably help you.
    Resizing grid with scrolling when data is less than scroll height.

    Thanks
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 19 Jan 2010 Link to this post

    Hello Princy,

    This looks to be exactly what I am searching for. I give a try.
    Thank you.

    CS
  5. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 19 Jan 2010 Link to this post

    Hello Princy,

    It works very well...but extremely slow and due to

    var

     

    dataHeight = sender.get_masterTableView().get_element().clientHeight;

     

     

    it causes a redraw of grid not very friendly.

    I don't understand why Telerik can't calculate this dataHeight before displaying ???

    Regards

    CS
  6. Dimo
    Admin
    Dimo avatar
    8330 posts

    Posted 19 Jan 2010 Link to this post

    Hi Christian,

    You can set

    <telerik:RadGrid  style="visibility:hidden"  />

    and remove that style after calculating the data div's height.

    // Javascript in the GridCreated handler
    sender.get_element().style.visibility = "";


    Kind regards,
    Dimo
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017