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

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

4 Answers 62 Views
Grid
This is a migrated thread and some comments may be shown as answers.
CSurieux
Top achievements
Rank 2
CSurieux asked on 18 Jan 2010, 05:37 PM
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

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 19 Jan 2010, 06:17 AM
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.
0
CSurieux
Top achievements
Rank 2
answered on 19 Jan 2010, 08:09 AM
Hello Princy,

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

CS
0
CSurieux
Top achievements
Rank 2
answered on 19 Jan 2010, 02:31 PM
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
0
Dimo
Telerik team
answered on 19 Jan 2010, 03:22 PM
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.
Tags
Grid
Asked by
CSurieux
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
CSurieux
Top achievements
Rank 2
Dimo
Telerik team
Share this question
or