This question is locked. New answers and comments are not allowed.
Hello,
I have a problem with column sorting and filtering in MVC Grid for the column which has ClientTemplate. Grid is defined as following (other columns omitted for brevity):@(Html.Telerik().Grid<Models.ProjectTimeRegisterView>().Name("Gridd") .DataKeys(keys => keys.Add(o => o.ProjectTimeRegisterId)) .ToolBar(commands => { commands.SubmitChanges(); }).Columns(columns =>{columns.Bound(o => o.Project).ClientTemplate("<#= Project.ProjectName #>").Title(Strings.View_ProjectName);}.DataBinding(dataBinding => { dataBinding.Ajax().Select("AjaxBinding", "ProjectController").Update("UpdateAjaxBinding", "ProjectController").Enabled(true); }) .ClientEvents(events => events.OnEdit("onEdit").OnSave("onSave").OnLoad("onLoad")) .Sortable(sorting => sorting .SortMode(GridSortMode.MultipleColumn) .OrderBy(sortOrder => sortOrder.Add(o => o.Date).Descending()) .OrderBy(sortOrder => sortOrder.Add(o => o.EmployeeFullName)) ) .Editable(editing => editing.Mode(GridEditMode.InCell).Enabled(!User.IsInRole(Mags.UserRoles.User))) .Pageable(paging => paging .Enabled(true) .PageSize(Mags.CommonConst.EntriesPerPage) .Position(GridPagerPosition.Both)) .Filterable(filtering => filtering.Enabled(true)) .Groupable(grouping => grouping.Enabled(true)) .Footer(true))
Model classes are as following (again, unimportant details omitted):
publicclassProjectViewModel{publicstringProjectName {get;set; }publicGuid ProjectGuid {get;set; }}publicclassProjectTimeRegisterView{[UIHint("Project"), Required]publicProjectViewModel Project {get;set; }}
When I try to sort data by that column, data is being sorted, but not in the correct order. For example after sorting in descending order, data might look like this:
Project "S"
Project A
Project C
Project B
Additionally, filtering doesn't work for that specific column - I can access filter widow for the column, but I can't select type of filter (i.e. "Starts with", "Contains" and e.t.c.), if I try to input some value into filter, I receive: "Error! The requested URL returned 500 - error"
Other columns can be filtered and/or sorted just fine.
Regards,
Andrey