Grid initial sorting does not work

3 posts, 1 answers
  1. Manu
    Manu avatar
    10 posts
    Member since:
    Jun 2016

    Posted 01 Jul Link to this post

    Hello,

    I can find out why initial sorting does not work for:

    var gridTest = $("#test-grid").kendoGrid({
        dataSource: gridDataSource(actions.search.fixTest, 100),
        sortable: true,
        pageable: false,
        scrollable: true,
        filterable: true,
        selectable: "row",
        resizable: true,
        width: 700,
        height: 630,
        columns: [
            { field: "Index", width: "60px" },
            { field: "NR", width: "60px" },
            { field: "Test", width: "400px" },
        ],
        sort: { field: "Index", dir: "desc" }
    });

    Everything else works fine; clicking on the column header does sorting. But no initial sorting!

    Any ideas?

    Best regards,

    Manu

     

  2. Answer
    Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 01 Jul Link to this post

    Hi,

    You are defining the sort line in the wrong place. You're putting it as one of the grid properties, but it is a datasource property. Below you can find a simple example with initial sorted column in the grid
    http://dojo.telerik.com/ExigI/8

    Regards,
    Pavlina
    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
  4. Manu
    Manu avatar
    10 posts
    Member since:
    Jun 2016

    Posted 04 Jul in reply to Pavlina Link to this post

    Thanks for the link, it helped to solve the problem.

    Regards

    Manu

Back to Top