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

[Solved] Can't Disable Grid Sorting in MVC 3 with Ajax Binding

0 Answers 28 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Malik Hassan
Top achievements
Rank 1
Malik Hassan asked on 29 Sep 2011, 11:49 AM
Hi ,

I am using MVC 3.0 and telerik controls for MVC 3.0 , I am trying to disable grid sorting on all columns using : 

Sortable(sorting => sorting.Enabled(false))

However , nothing has been changed , all columns still sortable , event disable sorting on each column using :

columns.Bound(o => o.Text).EditorTemplateName("MatchTypeText").Sortable(false)

isn't working too.

Here is my html code for the grid :


  @(Html.Telerik().Grid(Model)
                        .Name("Grid")
                    .DataKeys(p => p.Add(o => o.TextFilterId))
                         .DataBinding(dataBinding =>
                         {
                             dataBinding.Ajax().Update("textfiltersactions", "appsite", new { actionName = "update" });
                             dataBinding.Ajax().Delete("textfiltersactions", "appsite", new { actionName = "delete" });
                             dataBinding.Ajax().Insert("textfiltersactions", "appsite", new { actionName = "insert" });
                             dataBinding.Ajax().Select("textfiltersactions", "appsite");
                         })
                                 .ToolBar(commands => commands.Position(GridToolBarPosition.Top).Insert().ButtonType(GridButtonType.BareImage))
                    .Columns(columns =>
                    {
                        columns.Bound(o => o.Text).EditorTemplateName("MatchTypeText").Sortable(false);
                        columns.Bound(o => o.MatchTypeText).Width(180).EditorTemplateName("MatchTypeDropDownList").Sortable(false);
                        columns.Command(o =>
                        {
                            o.Edit().ButtonType(GridButtonType.BareImage);
                            o.Delete().ButtonType(GridButtonType.BareImage);
                        }).Width(100);
                    })
                    .EnableCustomBinding(true)
                    .Sortable(sorting => sorting.Enabled(false))
                    .Editable(editing => editing.Mode(GridEditMode.InLine))
                    .Scrollable(scrolling => scrolling.Enabled(false))
                                                .Footer(false).ClientEvents(events => events.OnError("textFilterOperationError")))


Please help me , I have to fix this issue ASAP.

Thanks
Tags
Grid
Asked by
Malik Hassan
Top achievements
Rank 1
Share this question
or