Grid Paging Error

2 posts, 0 answers
  1. Richard
    Richard avatar
    38 posts
    Member since:
    Mar 2011

    Posted 27 Jan Link to this post

    I'm using a Kendo UI Grid in conjunction with two AutoComplete widgets.  Everything mostly works perfectly, however, if a user pages through the grid and then does a search using one of the AutoComplete widgets, the grid does not display the data.  The pager at the bottom of the grid is updated but the grid is blank.  The user must click on a page before the data is displayed.  I have not been able to find a setting to resolve this despite hours of Googling.  Here's the code for my grid: 

            .Columns(columns =>
                columns.Bound(a => a.EmployeeOI).Visible(false);
                columns.Bound(a => a.DepartmentOI).Visible(false);
                columns.Bound(a => a.LevelId).Width(60).Title("Level");
                columns.Bound(a => a.DepartmentName).Width(150).Title("Department");
                columns.Bound(a => a.EmployeeId).Width(60).Title("Emp");
                columns.Bound(a => a.BuyerName).Width(100).Title("Buyer Name");
                columns.Bound(a => a.MinAmount).Width(100).Title("Min Amt");
                columns.Bound(a => a.MaxAmount).Width(100).Title("Max Amt");
                columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200);
            .ToolBar(toolbar => toolbar.Create())
            .Editable(editable => editable.Mode(GridEditMode.PopUp))
            .Sortable(s => s
        .HtmlAttributes(new { style = "height:650px;, width:100%" })
        .DataSource(dataSource => dataSource
            .Sort(x => x.Add(y => y.LevelId).Ascending())
            .Sort(x => x.Add(y => y.MaxAmount).Ascending())
            .Events(events => events.Error("error_handler"))
            .Read(read => read.Action("Read", "Home").Data("gridAddlData"))
            .Create(update => update.Action("EditingPopup_Create", "Home"))
            .Update(update => update.Action("EditingPopup_Update", "Home"))
            .Destroy(update => update.Action("EditingPopup_Destroy", "Home"))
          .Model(m =>
              m.Id(i => i.Id);
              m.Id(i => i.EmployeeOI);
              m.Id(i => i.DepartmentOI);
              m.Field("LevelID", typeof(string));
              m.Field("EmployeeId", typeof(string));
              m.Field("BuyerName", typeof(string));
              m.Field("MinAmount", typeof(decimal));
              m.Field("MaxAmount", typeof(decimal));
              m.Field("DepartmentId", typeof(string));

  2. Radoslav
    Radoslav avatar
    1564 posts

    Posted 29 Jan Link to this post

    Hi Richard,

    Thank you for contacting us.

    To avoid the described behavior you can try setting the grid pager to page one just before changing the datasource. For example:
    On the following link I created a small example which demonstrates this approach:

    Please give it try and let me know if it helps you.

    If you need further assistance, do not hesitate to contact us again.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET AJAX bannerTelerik UI for ASP.NET Core is out
Back to Top