ListView Won't Refresh

3 posts, 0 answers
  1. Graham
    Graham avatar
    9 posts
    Member since:
    Jul 2012

    Posted 03 Nov Link to this post

    Here's my MVC ListView:

    @(Html.Kendo().ListView<EntryExitBoard>()
        .Name("matrixEntryExitBoardLV")
        .DataSource(dataSource =>
        {
            dataSource.Read(read => read.Action("GetEntryExitBoard", "Warehouse").Data("getStartDepotNumber"));
        })
        .TagName("div")
        .ClientTemplateId("entryExitTemplate")
         .Selectable(selectable => selectable.Mode(ListViewSelectionMode.Single))
         .Events(events => events.Change("onEntryExitBoardChange"))
        )

     

    It loads initially with no problem. But when the following code tries to refresh it...

     

    var listView = $("#matrixEntryExitBoardLV").data("kendoListView");
    listView.refresh();

     

    It steps over the refresh without throwing an error, but the list view doesn't refresh.

     

  2. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2284 posts

    Posted 04 Nov Link to this post

    Hello Graham,

    Calling refresh method will re-read the data currently loaded in the dataSource and will repaint the widget. It is a common method for all data-driven widgets. 

    Notice that it will not make a request for fresh data if that is what you expect.

    Regards,
    Nikolay Rusev
    Telerik by Progress
    Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Graham
    Graham avatar
    9 posts
    Member since:
    Jul 2012

    Posted 04 Nov in reply to Nikolay Rusev Link to this post

    Thanks Nikolay.

     

    For future reference, the corrected JavaScript code is:

     

    var listView = $("#matrixEntryExitBoardLV").data("kendoListView");
    listView.dataSource.read();
Back to Top