I'm working on a MVC 4 project and bumped in to a problem with the Kendo Grid.
I try to use both the Sortable() and Filterable() properties of the grid, but only sorting is applied. The filter icons are visible in the columns but only triggers sorting. The Filterable() property works fine when Sortable() is removed though.
Below is the code for the grid (slightly edited for cleaner presentation)
I've also tried with the ColumnMenu() property based on your demo http://demos.kendoui.com/web/grid/column-menu.html
but the problem remains (ie the column menu icon can not be clicked).
Furthermore, when I set sortable in the ColumnMenu (like below), the options for "Sort ascending" and "Sort descending" are not displayed in the menu.
It would be great if I could get both filtering and sorting working on the grid.
Thanks,
Andreas
I try to use both the Sortable() and Filterable() properties of the grid, but only sorting is applied. The filter icons are visible in the columns but only triggers sorting. The Filterable() property works fine when Sortable() is removed though.
Below is the code for the grid (slightly edited for cleaner presentation)
@(Html.Kendo().Grid<
TaskViewModel
>()
.Name("UserTasksGrid")
.Columns(column =>
{
column.Bound(task => task.Title);
column.Bound(task => task.IsCompleted)
.ClientTemplate("<
input
type=\"checkbox\" #= (IsCompleted === true) ?
checked
=
'checked'
: '' # disabled=\"true\"")
column.Bound(task => task.TaskType)
column.Bound(task => task.DueDate).Format("{0:yyyy-MM-dd}")
column.Bound(task => task.CompletedOn)
.ClientTemplate("#= (IsCompleted == false) ? '' : kendo.toString(CompletedOn, 'yyyy-MM-dd') #")
column.Template(model => model).ClientTemplate("<
a
href
=
'/production/index?productionId=#=ProductionId#'
style=\"width:\">Gå till produktionssida</
a
>");
})
.Filterable()
.Sortable()
.Scrollable(scroll => scroll.Height(300))
.Pageable()
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.ServerOperation(false)
.Model(model => model.Id(m=> m.Id))
.Sort(sort => sort.Add(task => task.IsCompleted))
.Read(read => read.Action("UserTasks_Read", "Task"))
)
)
but the problem remains (ie the column menu icon can not be clicked).
Furthermore, when I set sortable in the ColumnMenu (like below), the options for "Sort ascending" and "Sort descending" are not displayed in the menu.
.ColumnMenu(menu => menu.Sortable(true))
Thanks,
Andreas