简体   繁体   中英

Kendo Grid Server Side Paging With Model Binding

Hi I have a kendo grid in my partial view.

And I have binded a model as the grid data source. And mention that my grid don't have a Read method. Instead of read method I have use the model.

Here is my view..

@model Project.MVC.Areas.Razor.Models.CustomerListModel

<div id="dvResultGrid">
    @(Html.Kendo().Grid<Portal.Application.BoundedContext.ScreenPop.Dtos.Customer>(Model.CustomerList)
    .Name("grdWindowResults")

    .Columns(columns =>
                   {
                       columns.Bound(x => x.Name1).Visible(true);
                       columns.Bound(x => x.Name2).Visible(true);
                       columns.Bound(x => x.ContactName);
                       columns.Bound(x => x.BillingAddress1);
                   })
    .Pageable()
    .Sortable(x => x.Enabled(false))
    .Scrollable(x => x.Height("auto"))
    .Selectable(selectable => selectable.Mode(GridSelectionMode.Single))
    .Reorderable(reorder => reorder.Columns(true))
    .DataSource(dataSource => dataSource
        .Ajax()
        .ServerOperation(false)                                                              
        .PageSize(5)
        .Model(model =>
                {
                    model.Id(p => p.CustomerId);

                })
    )
)
</div>

And what I have to do is, I need to do serverside paging for my grid. How can I do that with out a read method. Is there any option?

我已经回复了您的论坛主题

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM