How to set default column sorting to a grid

9 posts, 0 answers
  1. Yj
    Yj avatar
    1 posts
    Member since:
    Sep 2011

    Posted 27 Apr 2012 Link to this post

    I have a Keno Grid,  when first launched, it should be sorted on one column by descending order. How can achieve it? Is there any configuration parameters to set?
  2. Pechka
    Pechka avatar
    56 posts
    Member since:
    May 2010
  3. pucsoftware
    pucsoftware avatar
    24 posts
    Member since:
    Sep 2006

    Posted 10 Dec 2012 Link to this post

    I also need to have the grid's sort property established on the initial page request. The link provided below show's how to invoke the "sort" method of the data source but not how to pre-configure the datastore or grid to already have an initial sorted field. I'm sure it can be done but don't see how based on this link. Can you provide more info?
  4. Chrys
    Chrys avatar
    45 posts
    Member since:
    Feb 2013

    Posted 17 Jun 2014 in reply to Pechka Link to this post

    This seems to be bad link only links to the landing page for keno
  5. Sebastian
    Sebastian avatar
    9934 posts

    Posted 18 Jun 2014 Link to this post

    This should be the proper link to the relevant help article section, guys:

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Masaab
    Masaab avatar
    15 posts
    Member since:
    Nov 2013

    Posted 17 Aug 2014 in reply to Yj Link to this post

    TO Sort a Grid That is bound to a server dataSource.
    @(Html.Kendo().Grid<DataTableRow>()<br>                                    .Name("GridDisplay")<br>                                    .DataSource(dataSource =><br>                                                {<br>                                                    dataSource<br>                                                        .Ajax()<br>                                                        .Read(read => read.Action("ActionName", "Controller", new  {Id = @Model.Id}))<br>                                                        .PageSize(10)<br>                                                        .Sort(a => a.Add("Date/Time").Descending())<br>                                                        .ServerOperation(false);<br><br>                                                }<br>                                    )
  7. Dan
    Dan avatar
    2 posts
    Member since:
    May 2014

    Posted 22 Aug 2014 in reply to Sebastian Link to this post

    Thanks for the correct link!
  8. Brice
    Brice avatar
    2 posts
    Member since:
    Jul 2015

    Posted 14 Sep 2018 Link to this post

    Default sorting should be defined in the datasource configuration. 

    You could check documentation at this adress:


    Example : 

    var dataSource = new{
      data: [
        { name: "Jane Doe", age: 30 },
        { name: "John Doe", age: 33 }
      sort: { field: "age", dir: "desc" }
Back to Top