Search code examples
asp.net-mvc-3telerik-gridtelerik-mvc

Set page size on client side telerik grid


I have tried a lot but didn't find the way to change page size of telerik grid on client side Till now I have this on my grid

.Pageable(pager => pager.PageSize(25, new int[] { 25, 50, 100 })
.Style(GridPagerStyles.NextPreviousAndNumeric | GridPagerStyles.PageSizeDropDown))

It works fine but I want to bind page change event with one of my dropdowns.

I didn't find any event that telerik grid's page dropdown call that I can use to call with my dropdown change.

Is it possible to achieve this?


Solution

  • Found the way to do this

    function pageSizeChanged(pageSize) {
        if (pageSize == '#')
            return true;
    
        var grid = $('#StudentGrid').data('tGrid');
        grid.pageSize = pageSize;
        grid.rebind();
    }
    

    This works like a charm! :)