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

Sort in grid is sorting the column in ASCII order

1 Answer 15 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.
Yaamini
Top achievements
Rank 1
Yaamini asked on 11 Jul 2012, 09:34 AM
I have a telerik extension for ASP.Net MVC 3 grid when I try to sort the column it is sorting the data based on the ASCII value of the characters and not alphabetically

I am providing you my sample below

@{Html.Telerik().Grid(Model)<br>            .Name("Grid")<br>            .ToolBar(toolbar => toolbar.Custom().ButtonType(GridButtonType.Image).ImageHtmlAttributes(new { style = " background-image: url('../../Content/images/clear-filter.png') !important" }).HtmlAttributes(new { onclick = "clearFilters(event)", title = "Clear All Filters" }))<br>            .DataKeys(keys => keys.Add(c => c.ID))<br>            .Columns(columns =><br>            {<br>                columns.Bound(o => o.Name).Width(600);                     <br>            })<br>            .DataBinding(dataBinding => dataBinding.Ajax()<br>                .OperationMode(GridOperationMode.Client)<br>                .Select("_Method", "Controller"))<br>            .Pageable(pager => pager.Style(GridPagerStyles.PageSizeDropDown | GridPagerStyles.NextPreviousAndInput))<br>            .Filterable(filtering => filtering.Enabled(true))<br>            .Resizable(resizing => resizing.Columns(true))<br>            .ColumnContextMenu()<br>            .Sortable(s => s.Enabled(true))<br>            .Selectable()<br>            .Render();<br>            }


Can you help me in achieving the sort functionality

1 Answer, 1 is accepted

Sort by
0
Pedro
Top achievements
Rank 2
answered on 11 Jul 2012, 04:55 PM
Try sorting your grid data from your controller before you send it to your view.

Pedro
Tags
Grid
Asked by
Yaamini
Top achievements
Rank 1
Answers by
Pedro
Top achievements
Rank 2
Share this question
or