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

[Solved] GridOperationMode.Client Breaks Data Binding

0 Answers 20 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.
Marvin
Top achievements
Rank 1
Marvin asked on 25 May 2012, 05:11 PM
I've got a Grid that uses custom paging.
I just upgraded from 2011.1.315 to 2012.1.419 in order to make use of client sorting.

Unfortunately, as soon as I add ".OperationMode(GridOperationMode.Client)" to the data-binding declaration, no data is displayed anymore.
Is there something I'm missing?

Also, as the result set may be very large, I only want client-side sorting to be used when all data fits on one page.
When there are 10,000 rows, I don't want ALL of them to be loaded, instead, sorting should still happen on the server side (in the database).
(Btw, this used to work with the old version and  this unofficial extension to the grid - but I'd prefer to use a version that's officially supported.)

Here's my View code:

@(Html.Telerik().Grid<RecordViewModel>()
    .Name("Record")
    .Columns(columns =>
    {
        // column declarations omitted
 
    })
    .DataBinding(dataBinding =>
    {
        dataBinding.Ajax()
            .OperationMode(GridOperationMode.Client)
            .Select(Model.CallbackAction, Model.CallbackController);
    })
    .EnableCustomBinding(true)
    .Sortable(sorting =>
        {
            sorting.Enabled(Model.Sortable);
            if (Model.InitialSortingConfigurator != null)
                sorting.OrderBy(Model.InitialSortingConfigurator);
        })
    .Pageable(paging =>
    {
        paging.Enabled(Model.Pageable);
        if (Model.Pageable)
        {
            paging.PageSize(Model.PageSize);
            paging.PageTo(Model.CurrentPageNumber);
            paging.Total(Model.TotalRecords);
        }
    })
    //.Selectable()
    .ClientEvents(events =>
    {
        events.OnDataBinding("Grid_onDataBinding");
        events.OnDataBound("Grid_onDataBound");
        events.OnLoad("onGridLoaded");
        //events.OnRowSelected("OppdragListGrid_onOppdragSelected");
    })
    .Filterable(filterable =>
    {
        filterable.Enabled(Model.Filterable);
        if (Model.InitialFilterConfigurator != null)
            filterable.Filters(Model.InitialFilterConfigurator);
    })
    .PrefixUrlParameters(false)

Thanks!
Tags
Grid
Asked by
Marvin
Top achievements
Rank 1
Share this question
or