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

Grid Only Shows 1 Page Until Filtered

2 Answers 49 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Graham
Top achievements
Rank 2
Iron
Iron
Graham asked on 15 Apr 2015, 09:10 AM

My grid shows only 1 page of data until I apply a filter and then clear it. Having done that, it instantly shows all 28 pages.

 

1. does anyone have any idea what might be causing this?

 

2. is there any way to get it to recalculate the page list at the bottom of the grid after loading using a javascript command?

 

Here is the grid:

 

    @(Html.Kendo().Grid<tpnconnect.com.AdminService.DeviceDataEdit>()
        .Name("deviceGrid")
        .Columns(columns =>
        {
            columns.Bound(d => d.DepotNumber).Width(60);
            columns.Bound(d => d.DeviceName).Width(150);
            columns.Bound(d => d.DeviceAlias).Width(150);
            columns.Bound(d => d.AutoMode).Width(100).Title("Auto Mode").EditorTemplateName("AutoMode").ClientTemplate("#:AutoModeDisplay#");
            columns.Bound(d => d.CreatedDate).Title("Created").Format("{0:dd-MMM-yy HH:mm}").Width(80);
            columns.Bound(d => d.Active).Width(40).Filterable(true);
            columns.Command(command => { command.Edit(); command.Destroy(); }).Width(160);
        })
        .ToolBar(toolbar => toolbar.Create())
        .Editable(editable => editable.Mode(GridEditMode.InLine))
        .Pageable()
        .Sortable()
        .Filterable()
        .Scrollable()
        .HtmlAttributes(new { style = "height:430px;" })
        .DataSource(dataSource => dataSource
            .Ajax()
            .Model(model => model.Id(d => d.DeviceID))
            .PageSize(20)
            .ServerOperation(false)
            .Events(events => events.Error("error_handler"))
            .Create(update => update.Action("AddDevice", "Printer"))
            .Read(read => read.Action("GetAllDevicesForEdit", "Printer"))
            .Update(update => update.Action("UpdateDevice", "Printer"))
            .Destroy(update => update.Action("DeleteDevice", "Printer"))
        )
    )

2 Answers, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 17 Apr 2015, 07:57 AM
Hi Graham,

I am not sure what exactly is causing this, but I suspect that the Read Controller returns data in format different than the expected. For example: 
AggregateResults: null
Data: […]
Errors: null
Total: 123
I would recommend inspecting the network traffic either in the browser's network tab or using Fiddler to confirm if that is indeed the case. Also, sharing the GetAllDevicesForEdit implementation would allow us investigate further.

Regards,
Alexander Popov
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Graham
Top achievements
Rank 2
Iron
Iron
answered on 21 Jul 2016, 10:18 AM

Apologies for the delay replying: you were right - there was a missing field in the data.

 

btw - the date of the posts above should be Apr 2016, not Apr 2015.

Tags
Grid
Asked by
Graham
Top achievements
Rank 2
Iron
Iron
Answers by
Alexander Popov
Telerik team
Graham
Top achievements
Rank 2
Iron
Iron
Share this question
or