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

Controlling # of Rows Displayed in Scrollable Grid

6 Answers 156 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jim
Top achievements
Rank 1
Jim asked on 21 Jul 2011, 07:42 PM
The problem I'm having is that when I set the grid to be Scrollable(), it automatically adds a vertical scrollbar and shows only two rows of data at a time, even though I've told it that page size should equal 10.  If I remove Scrollable(), the grid displays 10 rows at a time, as desired, but it also extends beyond the width of the browser window, and items beyond the right edge of the screen are displayed in a somewhat garbled fashion.

Setting the Scrollable() grid's height to 80% is effectively ignored, and the grid goes right on displaying only two rows.

(a) I don't want the width of the grid to exceed the width of the browser window.
(b) Setting the width to a fixed number of pixels won't work:  some users have wide-screen and hi-res monitors, others don't.
(c) I want the grid to display an entire "page" worth of items vertically.

Thanks,
Jim

6 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 22 Jul 2011, 07:06 AM
Hi Jim,

 You can try setting the scrollable height to "auto". 

Regards,
Atanas Korchev
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Jim
Top achievements
Rank 1
answered on 22 Jul 2011, 02:12 PM
That did it.  Thanks!
0
Rick
Top achievements
Rank 2
answered on 20 Sep 2011, 11:23 PM
Can you point me to where in the MVC docs it talks about "scrollable" for the grid? I'm trying to find out exactly what it does and how it works. Thanks.
0
Dimo
Telerik team
answered on 21 Sep 2011, 06:28 AM
Hello Rick,

You can look in the API:

http://www.telerik.com/help/aspnet-mvc/m_telerik_web_mvc_ui_fluent_gridbuilder_1_scrollable_1.html

http://www.telerik.com/help/aspnet-mvc/allmembers_t_telerik_web_mvc_ui_fluent_gridscrollsettingsbuilder.html

Basically, you can enable scrolling and set height to the scrollable data area. Note that the height setting does not apply to the whole Grid, but only to the data area. So the Grid will be higher by the vertical space occupied by its header, pager, toolbar, etc.

Greetings,
Dimo
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 Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
JC
Top achievements
Rank 1
answered on 19 Dec 2011, 06:43 PM
Why is that not the default setting?
0
Dimo
Telerik team
answered on 20 Dec 2011, 09:07 AM
Hello JC,

Grid scrolling produces a little more complex HTML output (two tables) and requires Javascript to work correctly. On the other hand, it is true that a lot of Grids have scrolling enabled to save real estate on the page. So there are both pros and cons and it is a more or less a political question. In the past we have opted for scroll-less Grid by default. I am not sure we would do the same if we had to make the same decision now, but this is how it's done. Switching the behavior now will not bring any real benefit, but will break existing applications, so there is no sense in doing it.

Greetings,
Dimo
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 Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
Grid
Asked by
Jim
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Jim
Top achievements
Rank 1
Rick
Top achievements
Rank 2
Dimo
Telerik team
JC
Top achievements
Rank 1
Share this question
or