This is a migrated thread and some comments may be shown as answers.

Columns in Grid are clickable for sort even though they are set to false

1 Answer 50 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Trent Jones
Top achievements
Rank 1
Trent Jones asked on 01 Aug 2012, 01:57 PM
I have a kendo grid using the MVC Extensions.  I have set the grid to Sortable and the columns i don't want sorting on to false. However, once rendered to the page all columns headers are still clickable but only the ones marked sortable get the 'hand' icon.  For instance, i have a 'select all column'  and a 'group list' column that i don't want sorted.

@(Html.Kendo().Grid<MyViewModel>()
    .Name("my-list")
    .HtmlAttributes(new { @class = "grid" })
    .DataSource(d =>
    {
        var dsStep = d.Ajax();
        dsStep.Read(read => read.Action("_Index", "Matter"))
            .PageSize(Model.InitialPageSize);
    })
    .Columns(columns =>
    {
        columns.Bound(p => p.Selected).Sortable(false).ClientTemplate(
            "<input type='hidden' name='list.Index' value='#=ID#'/>" +
            "<input type='checkbox' id='list_#=ID#__Selected' name='list[#=ID#].Selected' value='true'/>").Width(50);
        columns.Bound(p => p.Name).Template(t =>
        {
            Html.ActionLink(t.Name, "Index", "Detail", new { id = t.ID });
        })
            .ClientTemplate("<a href='" + @Url.Content("~/Detail/Index") + "/#=ID#'>#=Name#</a>");
        columns.Bound(p => p.Number).Width(50);
        columns.Bound(p => p.Clients).Sortable(false);
        columns.Bound(p => p.Area.Name).Width(100);
        columns.Bound(p => p.Staff).Sortable(false);
        columns.Bound(p => p.DateOpenedFormatted).Sortable(true);;
 
    })
    .Resizable(r => r.Columns(true))
    .Events(events => events.DataBound("wow"))
     
    .Pageable()
    .Sortable(sort => sort.SortMode(GridSortMode.SingleColumn))
    .Selectable(a => a.Mode(GridSelectionMode.Multiple).Type(GridSelectionType.Row))
)

Any help would be great.  I am going to try the same on jsfiddle (using the js version) to see if i can reproduce.

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 02 Aug 2012, 08:37 AM
Hello Trent,

I'm afraid that I'm unable to observe such behavior locally. Therefore, please provide a small runnable sample application in which this behavior can be observed locally.

Regards,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Trent Jones
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or