grid setOptions() deletes all data

2 posts, 0 answers
  1. Gavin
    Gavin avatar
    3 posts
    Member since:
    Jun 2016

    Posted 22 Jun Link to this post

    Hi, Am using Telerik MVC wrappers for creating a grid. Done an ultra simple example of this and this seems to be enough to repeat the issue:

     

    cshtml:

    @Html.Kendo().Grid(Model.Records).Name("Search")

    If I just use the above, I get the grid with all the data in it no problem, however if I decide I want to make it sortable on the fly, I run what I understand to be the correct js below, this just causes all the data to be deleted with no errors.

    javascript:

    $('#Search').data('kendoGrid').setOptions({ sortable: true });

     

    is there something you have to do with MVC wrapper settings to make the javascript methods less flaky?

     

    Also, am using latest trial version as of this date.

     

    Thanks,

    Gavin

  2. Kostadin
    Admin
    Kostadin avatar
    1711 posts

    Posted 24 Jun Link to this post

    Hi Gavin,

    I am afraid this will not work in case you are using a Server binding because the Grid does not expose such option and also you cannot modify the QueryString parameters (the collection is read only). in order to be able to set the sortable by using the setOption method you need to use an Ajax binding.

    Regards,
    Kostadin
    Telerik
    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 MVC is VS 2017 Ready
Back to Top