Is there a way I can extract this code out into a variable or template so I don't have to define it for each column I want to use it on?
@(Html.Kendo().Grid<
Kendo.Mvc.Examples.Models.EmployeeViewModel
>()
.Name("Grid")
.Columns(columns => {
columns.Template(@<
text
>@item.FirstName @item.LastName</
text
>)
.ClientTemplate("#=FirstName# #=LastName#")
.Title("Name");
columns.Bound(e => e.City)
.Filterable(filterable => filterable.UI("cityFilter"))
.Width(200);
columns.Bound(e => e.Title)
.Filterable(filterable => filterable.UI("titleFilter"))
.Width(350);
})
.Filterable(filterable => filterable
.Extra(false)
.Operators(operators => operators
.ForString(str => str.Clear()
.StartsWith("Starts with")
.IsEqualTo("Is equal to")
.IsNotEqualTo("Is not equal to")
))
)
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("FilterMenuCustomization_Read", "Grid"))
)
)