Hi Guys,
Just ran into an issue that if I make my grid page by scroll like below
.Pageable(paging => paging.Style(GridPagerStyles.Status).PageOnScroll(true)
and specifying the action method. It works fine, but when I try to make the grid height "auto", like below
.Scrollable(scrolling => scrolling.Height("auto"))
then the no matter how you scroll the grid, it does not jump to the next page. As the grid itself does not contain an scroll bar vertically.
This even does not work with the number set to any values like below.
.Scrollable(scrolling => scrolling.Height("500"))
Could anyone help me out?
thanks,
Richard
5 Answers, 1 is accepted

I have a similar grid and it jump to the next page using jquery.
Take a look:
.Pageable(paging => paging
.Style(GridPagerStyles.NextPreviousAndNumeric)
.Position(GridPagerPosition.Bottom)
.PageSize(20)
.PageOnScroll(true))
.ClientEvents(events => events.OnDataBinding("OnDataBinding"))
.Scrollable(scrool => scrool.Height(380).Enabled(true))
.TableHtmlAttributes(new { style = "width:auto" })
//Jquery event
function OnDataBinding(e) {
e.data = $.extend({}, e.data);
}
My grid is working very weel...

Deise,
Thanks so much for the answer!
However, I don't quite understand how your Jquery ondatabinding event gonna work. It seems when I set the Scroll.Height to AUTO, there would be no scroll bar available on the page. So it's really not possible to trigger the onScroll event when scrolling the mouse wheel... and the paging's simply not working in that case.
thanks,
Richard

You are right, is not necessary to use the jquery function.
I did a grid similar this Demo and it works exactly same! This is my grid:
@(Html.Telerik().Grid(Model.grid)
.Name("GridGrupo")
.DataKeys(keys =>
{
keys.Add(p => p.Id);
})
.DataBinding(dataBinding =>
{
dataBinding.Ajax().Select("Grid", "Grupo");
})
.Columns(columns =>
{
columns.Bound(p => p.Id).Hidden(true).IncludeInContextMenu(false);
columns.Bound(p => p.Descricao).Width(500).Title("Descrição");
})
.ClientEvents(events => events.OnRowSelect("onRowSelected"))
.Sortable(sorting => sorting.SortMode(GridSortMode.SingleColumn))
.Pageable(paging => paging.Style(GridPagerStyles.Status).PageOnScroll(true))
.Filterable()
.Selectable()
)
The property PageOnScroll define if you have lots of records, when you scrolling the page the records are showing. If you define the height of the grid, when you add a record your grid will adjust automatically and the "PageOnScroll" will not work.
I did two samples: with Scroll.Height and not with it. Take a look the attachments.
In the "GridWithScrollHeight" sample I used "Scrollable(scrool => scrool.Height("auto").Enabled(true))" and in the second sample I didn't use this.
Best Regards.

Yes, I would say Auto height(Height set to auto) works together with PageSize. Whenever auto height is enabled, it limits the page height to the pagesize you set to and never let PageOnScroll happen. So in this case, this is still a issue that Telerik team need to look after...
In another hand, even we could set the height to enable PageOnScroll, but still, the height is something from our guess.
I will write to Telerik to get some response on it.
thanks,
Richard

If you get some answer from Telerik please tell me....I have lots of problems with this control...G