EditCell with widgets Kendo Grid MVC - asp.net-mvc

I have a grid with some editor templates. The grid can be edited InCell.
I want to change the edit inCell event so that it will edit the values on double click. Untill now I have done it like this :
$(table + " table").on("dblclick",
"tbody>tr>td",
function(e) {
var grid = $(table).data("kendoGrid");
grid.editCell($(this));
});
The problem that I have is that when I double click on the cell, the widget that I want for editing (Multiselect, DropdownList ...) is not rendered in the grid and looks like this :
Instead, it should look like this:
One of the editors looks like this :
#(Html.Kendo().DropDownList()
.Name("Responsible")
.DataTextField("ResponsibleName")
.DataValueField("ResponsibleId")
.BindTo((System.Collections.IEnumerable)ViewData["Responsible"])
);
The definition of the grid is :
#(Html.Kendo().Grid(Model.ActivitiesList)
.Name(Model.ActivitiesSection)
.ClientDetailTemplateId(Model.ActivitiesSection + "-description")
.Columns(columns =>
{
columns.Bound(c => c.ActivityId).Title(#Html.Kendo().CheckBox().Name("check-#=ActivitiesSection#").Checked(false).Enable(false).ToString()).ClientTemplate(#Html.Kendo().CheckBox().Name("check-#=ActivityId#").Checked(false).ToString()).Sortable(false);
columns.Bound(c => c.StatusColor).Title("").ClientTemplate("<i class='fa fa-circle' aria-hidden='true' style='font-size: smaller; color:#=StatusColor#;'></i>").Sortable(false);
columns.Bound(c => c.StatusDescription).Title("Status").ClientTemplate("#=StatusDescription#");
columns.Bound(c => c.Name).Title("Name").ClientTemplate("<p class='activity-name'>#=Name#</p>");
columns.Bound(c => c.Priority).Title("Priority").ClientTemplate("#=PriorityTemplate(Priority)#");
columns.Bound(c => c.Responsible).Title("Responsible").HtmlAttributes(new { #class = "templateCell" }).ClientTemplate("#=ResponsibleTemplate(Responsible)#");
columns.Bound(c => c.Team).Title("Team").ClientTemplate("Better solutions");
columns.Bound(c => c.GeographicResponsibility).Title("Geographic Resp").HtmlAttributes(new { #class = "templateCell" }).ClientTemplate("#=GeographicResponsibilityTemplate(GeographicResponsibility)#").EditorTemplateName("_GeographicalResponsibilityEditor");
columns.Bound(c => c.FunctionOrPracticeResponsible).Title("Function/Practice Resp").HtmlAttributes(new { #class = "templateCell" }).ClientTemplate("#=FunctionOrPracticeResponsibleTemplate(FunctionOrPracticeResponsible)#").EditorTemplateName("_FunctionResponsibleEditor");
columns.Bound(c => c.DueDate).Title("Due date").ClientTemplate("<p style='white-space: nowrap'>#= DueDate != null ? kendo.toString(kendo.parseDate(DueDate,'dd/MM/yyyy'), 'dd-MM-yyyy') : 'DD-MM-YY' #</p>").EditorTemplateName("_ActivityDueDateEditor");
columns.Bound(c => c.Starred).Title("<i class='fa fa-star' aria-hidden='true' style='color: #ededed; font-size:large;'></i>").ClientTemplate("<i class='fa fa-star' aria-hidden='true' style='color:\\#ededed;'></i>").Sortable(false);
columns.Bound(c => c.StatusDescription).Title("<i class='fa fa-file' aria-hidden='true' style='color: #ededed; font-size:large'></i>").ClientTemplate("<i class='fa fa-file' aria-hidden='true' style='color:\\#ededed;'></i>").Sortable(false);
columns.Bound(c => c.ActivityId).Title("").ClientTemplate("<input type='button' value='More Info' class='expanded-section' id='#= ActivityId #'/>").Sortable(false);
columns.Bound(c => c.ActivityId).Title("").ClientTemplate("<input type='hidden' class='js-activity-id' value='#= ActivityId #'").Sortable(false);
columns.Bound(c => c.KeyLaunchElementId).Hidden(true);
columns.Bound(c => c.ProcessMapId).Hidden(true);
columns.Bound(c => c.WorkstreamId).Hidden(true);
})
.DataSource(e => e.Ajax().ServerOperation(false).Sort(a => a.Add("Name").Ascending())
.Model(model =>
{
model.Id(act => act.ActivityId);
model.Field(act => act.Name);
model.Field(act => act.ActivityId).Editable(false);
model.Field(act => act.Priority).DefaultValue(new ActivityPriorityViewModel());
model.Field(act => act.StatusColor).Editable(false).DefaultValue("#00b0d3");
model.Field(act => act.StatusDescription).DefaultValue("New").Editable(false);
model.Field(act => act.Responsible).DefaultValue(new ActivityResponsibleViewModel());
model.Field(act => act.Team).Editable(false);
model.Field(act => act.GeographicResponsibility).DefaultValue(new GeographicalResponsibilityViewModel());
model.Field(act => act.FunctionOrPracticeResponsible).DefaultValue(new List<FunctionOrPracticeViewModel>());
model.Field(act => act.DueDate);
model.Field(act => act.Starred).Editable(false);
})
.Update(update => update.Action("UpdateActivity", "Activity"))
.AutoSync(true))
.Events(events => events.DetailExpand("detailExpand").Save("function(e) { this.dataSource.sync() }").DataBound("activityFilter.IsSorted"))
.Sortable(s => s.SortMode(GridSortMode.SingleColumn).AllowUnsort(false))
.Editable(edit => edit.Mode(GridEditMode.InCell))
)
Thank you!

At first create new editor and place it under directory: Views/Shared/EditorTemplates directory. I created "DropdownTest.cshtml" editor:
#using Kendo.Mvc.UI
#(
Html.Kendo().DropDownListFor(m => m)
.BindTo((System.Collections.IEnumerable)ViewData["Responsible"])
.DataValueField("ResponsibleId")
.DataTextField("ResponsibleName")
)
ViewData["Responsible"] is used to list all of positions while editing, so it must be initialized in view method:
public ActionResult Index()
{
ViewData["Responsible"] = new List<Responsible>()
{
new Responsible
{
ResponsibleId = 1,
ResponsibleName = "Test-A"
},
new Responsible
{
ResponsibleId = 2,
ResponsibleName = "Test-B"
}
};
return View();
}
A grid wrapper column definition (instead of bound - use foreign key):
columns.ForeignKey(p => p.Responsible.ResponsibleId, (System.Collections.IEnumerable)ViewData["Responsible"],
"ResponsibleId", "ResponsibleName").EditorTemplateName("DropdownTest");
EditorTemplateName("DropdownTest") is linked to editor from EditorTemplates directory.

Related

How do I access a ViewModel field from Kendo Grid MVC column definition?

How do I access the c => c.IsExpired field down below in place of the >>> ISEXPIRED <<< placeholder?
#(Html.Kendo().Grid<Corporate.Models.OrderModel>()
.Name("ordersGrid")
.Columns(columns =>
{
columns.Template(#<text></text>)
.ClientTemplate(AdminDeleteEditTemplate().ToHtmlString())
.Visible(isAdmin)
.Width(110);
columns.Bound(c => c.OrderID)
.ClientTemplate(Html.ActionLink("#= OrderID #", "Details", "Orders", new { id = "#= OrderID #" }, new { }).ToHtmlString())
.HtmlAttributes(new { #class = "text-right" });
columns.Bound(c => c.ResellerName).ClientTemplate("#= ResellerID ? ResellerName : '' #");
columns.Bound(c => c.Date).Format("{0: MMM d, yyyy}").HtmlAttributes(new { #class = "text-right" });
columns.Bound(c => c.ExpirationDate)
.ClientTemplate("#= IsExpired == false ? kendo.toString(kendo.parseDate(ExpirationDate), 'MMM d, yyyy').concat(IsExpiringSoon ? '<small> (expiring soon)</small>' : '') : '' #")
.HtmlAttributes(new { #class = "text-right" });
columns.Bound(c => c.StringList)
.Template(#<text></text>)
.ClientTemplate("#= renderActions(data) #")
.Title("Actions")
.Visible(!Model.HideOptions);
columns.Template(#<text></text>)
.ClientTemplate(AdminOthersTemplate(>>> ISEXPIRED <<<).ToHtmlString())
.Visible(isAdmin);
})
.Events(e => e.DataBound("onOrdersDataBound"))
.Sortable()
Try to pass the data object to the template function
columns.Template(#<text></text>)
.ClientTemplate("#= AdminOthersTemplate(data) #")
.Visible(isAdmin);
and
AdminOthersTemplate(data){
console.log(data.IsEscaped);
}

Kendo MVC Grid will not hide columns with media query

My Kendo grid incorrectly displays the responsive column when the page is viewed on a desktop (width > 2000px). My grid code is below. It seems like .Media("(max-width: 450px)"); in the last column doesn't work. It renders fine on a small screen. Only the last column is displayed.
<% Html.Kendo().Grid<WWT.Models.GageList>()
.Name("StationGrid")
.Selectable(s => s.Mode(Kendo.Mvc.UI.GridSelectionMode.Single))
.Filterable(filter =>
{
filter.Extra(false);
filter.Operators(op =>
{
op.ForString(str => str.Clear());
op.ForString(str =>
{
str.Clear().Contains("Contains");
});
});
filter.Mode(GridFilterMode.Row);
})
.Sortable(a => a.Enabled(true))
.Events(events => events
.DataBound("onDataBound")
.Change("AddRowClick")
)
.Pageable(pageable => pageable
.Refresh(true)
.PageSizes(true)
.ButtonCount(5))
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("IndexReplaceStation", "Window", new { company = Model.company, gageSN = Model.id, model = Model.model }).Data("GridSearchData"))
.PageSize(20)
)
.Columns(columns =>
{
columns.Bound(c => c.ModelNumber).Title("Model").HtmlAttributes(new { #class = "telerikGridCell" }).MinScreenWidth(450);
columns.Bound(c => c.SID).Title("SID").HtmlAttributes(new { #class = "telerikGridCell" }).MinScreenWidth(450);
columns.Bound(c => c).ClientTemplate("#=resColTemplate(data)#").Title("").Media("(max-width: 450px)");
})
.Scrollable(scrolling => scrolling.Height(150))
.Render();
%>
</div>
<script id="responsive-column-template" type="text/x-kendo-template">
<strong>Model</strong>
<p class="col-template-val">#=data.ModelNumber#</p>
<strong>SID</strong>
<p class="col-template-val">#=data.SID#</p>
</script>
I use min-width at 320 and 850px breakpoints.
cols.Bound(x => x.SectionCode)
.HeaderHtmlAttributes(new { style = "text-align:center" })
.Media("(min-width: 320px)")
.Width("25%");

Set page size to all on load on a kendo grid

I have a simple question I cannot seem to find the answer to. I would like the grid to default to show all results on load. If possible even take out the paging at the bottom but I cannot seem to find it anywhere.
This is my grid:
#(Html.Kendo().Grid<Website.Models.LinesForPayType.LinesForPayTypeGridModel>()
.Name("gridAssignLines")
.ToolBar(toolbar =>
{
toolbar.Create().HtmlAttributes(new { #id = "CreatePaymentTypeLine", #style = "display:inline-block;" });
toolbar.Save().SaveText("Create Invoice").HtmlAttributes(new { id = "create-invoice", href = "#" }); ;
})
.Columns(columns =>
{
columns.Select().Width(30);
columns.Bound(c => c.Description);
columns.Bound(c => c.LineNo);
columns.Bound(c => c.Quantity);
columns.Bound(c => c.UnitPrice)
.ClientTemplate(Model.HomeCurrencySymbol + " #=kendo.toString(UnitPrice ? UnitPrice : 0,'n2')#");
columns.Bound(c => c.Total)
.ClientTemplate(Model.HomeCurrencySymbol + " #=kendo.toString(Total ? Total : 0,'n2')#");
})
.Events(e => e.DataBound("AddStudentController.onCheckClick"))
.Pageable(page => page
.Refresh(true)
.PageSizes("All")
)
.Editable(edit => edit.Mode(GridEditMode.InCell))
.Scrollable()
.Events(events => events.Save("AddStudentController.onInvoiceGridSave"))
.Reorderable(reorder => reorder.Columns(true))
.NoRecords("No data")
.Filterable(f => f.Operators(o => o.ForString(fs => fs.Clear().Contains("Contains").StartsWith("Start With").EndsWith("End with").IsEqualTo("Is equal to").IsNotEqualTo("Is not equal to"))))
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(true)
.Sort(s =>
{
s.Add(a => a.LineNo).Ascending();
})
.Model(model =>
{
model.Id(i => i.ID);
})
.Read(read => read.Action("ReadPaymentTypeLines", "Payment").Data("AddStudentController.getPaymentTypeID"))
.Create(create => create.Action("CreatePaymentTypeLines", "Payment"))
.Update(update => update.Action("CreatePaymentTypeLines", "Payment"))
)
)
Set the datasource's PageSize to int.MaxValue (e.g. https://docs.telerik.com/aspnet-mvc/api/Kendo.Mvc.UI.Fluent/GridBuilder#datasourcesystemstring) and if you don't want to see the paging stuff, set Pageable to false.

Telerik MVC Grid - How to add a new record?

I have a Telerik Kendo Grid and I am adding a record when I click a button:
var dataSource = $("#GridArticulos").data("kendoGrid").dataSource;
dataSource.add({ ArticuloId: articuloId, Nombre: nombre, Precio:
precio, Cantidad: cantidad, Total: total });
dataSource.sync();
The record is added correctly to the grid, but when I click the save button on the grid, nothing happens, the action in the controller is not called, do I need some specific configuration on the grid?, this is what I have now:
#(Html.Kendo().Grid<App.Models.ArticulosListaViewModel>()
.Name("GridArticulos")
.AutoBind(false)
.Columns(columns =>
{
columns.Bound(c => c.ArticuloId).Width("15%");
columns.Bound(c => c.Nombre).Width("35%").ClientFooterTemplate("Total"); ;
columns.Bound(c => c.Cantidad).Width("10%").HtmlAttributes(new { style = "text-align:right" });
columns.Bound(c => c.Precio).Width("10%").Format("{0:C}").HtmlAttributes(new { style = "text-align:right" });
columns.Bound(c => c.Total).Width("10%").Format("{0:C}").HtmlAttributes(new { style = "text-align:right" })
.ClientFooterTemplate("<div align=\"right\">#=kendo.format('{0:C}', sum)#</div>");
columns.Command(command => command.Destroy()).Width("20%");
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
.ToolBar(toolbar =>
{
toolbar.Save().SaveText("Crear pedido").CancelText("Cancelar");
})
.Selectable(s => s.Mode(GridSelectionMode.Single).Type(GridSelectionType.Cell))
.Scrollable()
.Resizable(resize => resize.Columns(true))
.HtmlAttributes(new { style = "height:550px", #class = "ra-section" })
.DataSource(dataSource => dataSource
.Ajax()
.Aggregates(aggregates =>
{
aggregates.Add(p => p.Total).Sum();
})
.Batch(true)
.ServerOperation(false)
.Events(events => events.Error("GridArticulos_Error").RequestEnd("GridArticulos_RequestEnd"))
.Model(model =>
{
model.Id(a => a.ArticuloId);
model.Field(a => a.Nombre).Editable(false);
model.Field(a => a.Cantidad).Editable(false);
model.Field(a => a.Precio).Editable(false);
model.Field(a => a.Total).Editable(false);
})
//.Create(create => create.Action("GuardarPedido", "Pedidos").Data("ObtenerDatos"))
.Update(update => update.Action("GuardarPedido", "Pedidos").Data("ObtenerDatos"))
.Destroy(d => d.Action("EliminarArticulo", "Pedidos"))
)
)
you have your .Create() method commented out. uncomment it and point it to the appropriate controller method and you should be fine
uncomment this line--> //.Create(create => create.Action("GuardarPedido", "Pedidos").Data("ObtenerDatos"))
.Update(update => update.Action("GuardarPedido", "Pedidos").Data("ObtenerDatos"))
.Destroy(d => d.Action("EliminarArticulo", "Pedidos"))
also, your create method is pointed to the same method as your update method on the line below it so you would need to edit the method to point to another method. I can't help there since I don't know what methods you have in your controller

Telerik Kendo MVC Grid - How do I set onload/initial filter equals True with checkbox columns?

I've been charged with changing my company's current webforms site pages to MVC. We use the Telerik tools package and I am looking for a way to set an initial filter on my grid so that when the page is loaded the grid defaults to showing only records that are checked (true). I have found several questions similar to this but so far none of the answers I have found in those instances dealt with checkboxes.
The code below is my "Active?" = True/False column in the MVC grid. I'm checking the deleted date for each record, which is treated as "deactivated" when a delete date exists. My user-initiated filtering works great on the grid but I am having trouble figuring out how to set the initial filter value on this column to TRUE while also allowing the user to clear the filter to then view deactivated records along with the active records.
I appreciate any help you can offer. If I'm implementing this completely wrong, feel free to let me know, but please also include an example of the correct way to accomplish this functionality.
columns.Bound("DeleteDateUTC")
.ClientTemplate("<input type='checkbox' #= kendo.parseDate(DeleteDateUTC) ? '' : checked='checked' # disabled='disabled' />")
.Title("Active?")
.Filterable(ftb => ftb.Cell(cell => cell.Operator("Is equal to")))
.Width(100);
Thank you!
EDIT 1:
<div id="gridArea" class="k-virtual-scrollable-wrap">
#(Html.Kendo().Grid<dynamic>()
.Name("OperatorsGrid")
.Mobile(MobileMode.Auto)
.Pageable(pager => pager.PageSizes(new int[] { 50, 100, 250 })
.Refresh(true))
.Sortable()
.Resizable(resize => resize.Columns(true))
.HtmlAttributes(new { style = "height: 800px;" })
.Scrollable()
.ColumnMenu()
.Filterable(ftb => ftb.Mode(GridFilterMode.Row))
.Events(e => e.DataBound("onDataBound").Cancel("onCancel"))
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
model.Id("ID");
})
.PageSize(100)
.Read(read => read.Action("Operators_Read", "TableMx"))
)
.Columns(columns =>
{
columns.Command(cmd => cmd.Custom("Operators_Edit").Text(" ").Click("edit"))
.Title("Edit")
.Width(75);
columns.Command(cmd => cmd.Custom("Operators_Deactivate").Text(" ").Click("deactivate"))
.Title("Deactivate")
.Width(100);
columns.Bound("DeleteDateUTC")
.ClientTemplate("<input type='checkbox' #= kendo.parseDate(DeleteDateUTC) ? '' : checked='checked' # disabled='disabled' />")
.Title("Active?")
.Filterable(ftb => ftb.Cell(cell => cell.Operator("Is equal to")))
.Width(100);
columns.Bound("Name")
.Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")))
.Title("Name")
.Width(350);
columns.Bound("Address")
.Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")))
.Title("Address")
.Width(250);
columns.Bound("City")
.Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")))
.Title("City")
.Width(150);
columns.Bound("StateAbbrev")
.Filterable(ftb => ftb.Cell(cell => cell.ShowOperators(false)))
.Title("State")
.Width(100);
columns.Bound("Zip")
.Filterable(false)
.Title("Zip")
.Width(70);
columns.Bound("ContactName")
.Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")))
.Title("Contact Name")
.Width(175);
columns.Bound("ContactEmail")
.Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")))
.Title("Email")
.Width(175);
columns.Bound("ContactPhone")
.Filterable(ftb => ftb.Cell(cell => cell.ShowOperators(false)))
.Title("Phone")
.Width(150);
columns.Bound("CreateDateUTC")
.ClientTemplate("#= kendo.parseDate(CreateDateUTC) ? (kendo.toString(kendo.parseDate(CreateDateUTC), 'MM/dd/yyyy h:mm tt')) : '' #")
.Title("Create Date UTC")
.Width(250);
columns.Bound("CreatedByUser")
.Title("Created By")
.Width(150);
columns.Bound("LastChangeDateUTC")
.ClientTemplate("#= kendo.parseDate(LastChangeDateUTC) ? (kendo.toString(kendo.parseDate(LastChangeDateUTC), 'MM/dd/yyyy h:mm tt')) : '' #")
.Title("Last Update Date UTC")
.Width(250);
columns.Bound("LastChangedByUser")
.Title("Last Updated By")
.Width(150);
columns.Bound("DeleteDateUTC")
.ClientTemplate("#= kendo.parseDate(DeleteDateUTC) ? (kendo.toString(kendo.parseDate(DeleteDateUTC), 'MM/dd/yyyy h:mm tt')) : '' #")
.Title("Deleted Date UTC")
.Width(250);
columns.Bound("DeletedByUser")
.Title("Deleted By")
.Width(150);
})
)
EDIT 2:
Adding script section below grid. I'm not sure if this is required in order to help me out but it can't hurt to see everything that's going on.
<script>
$(function () {
var grid = $("#OperatorsGrid").data("kendoGrid");
//Save personalized settings for this grid (columns shown, etc.)
$("#save").click(function (e) {
e.preventDefault();
localStorage["kendo-grid-options"] = kendo.stringify(grid.getOptions());
});
//If the user has saved options, load them. Otherwise, load the default filter for the active column
var options = localStorage["kendo-grid-options"];
if (options) {
grid.setOptions(JSON.parse(options));
}
else {
grid.dataSource.filter({ field: "Active?", operator: "eq", value: "checked" });
}
//Remove column menu from any columns specified by data-title below:
//grid.thead.find("[data-title=columnTitleHere]>.k-header-column-menu").remove();
grid.thead.find("[data-title=\"Active?\"]>.k-header-column-menu").remove();
});
function deactivate(e) {
e.preventDefault();
var id = this.dataItem($(e.currentTarget).closest("tr")).id;
var url = "/TableMx/Operators_Deactivate/" + id;
$.ajax({
type: "POST",
url: url,
})
.done(function () {
// refresh the grid to remove the just deactivated order
refreshGrid();
})
.fail(function () { alert("failure deactivating operator") })
}
function edit(e) {
}
function onDataBound(e) {
$(".k-grid-Operators_Deactivate span").addClass("k-icon k-delete ob-icon-only");
$(".k-grid-Operators_Edit span").addClass("k-icon k-edit ob-icon-only");
}
function onCancel(e) {
e.preventDefault();
e.sender.refresh();
}
function refreshGrid() {
if ($(".k-i-refresh").length > 0) {
$(".k-i-refresh").trigger('click');
}
}
Instead of using a dynamic model, create a view model like this:
public class OperatorViewModel
{
// I'm not sure if your ID is int or string...
public int ID { get; set; }
public string Name { get; set; }
public string Address { get; set; }
public string City { get; set; }
// All the other properties here
// ...
// ...
[Display(Name = "Active?")]
public bool IsActive { get; set; }
}
As you see, I also added an IsActive property to the view model. You'll populate this property in your Controller, depending on whether there is a DeleteDateUTC or not.
Then, your grid will be like (Note the .Filter I added to your data source):
#(Html.Kendo().Grid<YourApp.ViewModels.OperatorViewModel>()
.Name("OperatorsGrid")
.Mobile(MobileMode.Auto)
.Pageable(pager => pager.PageSizes(new int[] { 50, 100, 250 })
.Refresh(true))
.Sortable()
.Resizable(resize => resize.Columns(true))
.HtmlAttributes(new { style = "height: 800px;" })
.Scrollable()
.ColumnMenu()
.Filterable(ftb => ftb.Mode(GridFilterMode.Row))
.Events(e => e.DataBound("onDataBound").Cancel("onCancel"))
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
model.Id("ID");
})
// THIS IS WHERE YOU FILTER THE IsActive FIELD
.Filter(f => f.Add(m => m.IsActive.Equals(true)))
.PageSize(100)
.Read(read => read.Action("Operators_Read", "TableMx"))
)
.Columns(columns =>
{
columns.Command(cmd => cmd.Custom("Operators_Edit").Text(" ").Click("edit"))
.Title("Edit")
.Width(75);
columns.Command(cmd => cmd.Custom("Operators_Deactivate").Text(" ").Click("deactivate"))
.Title("Deactivate")
.Width(100);
columns.Bound(c => c.IsActive)
.ClientTemplate("<input type='checkbox' #= IsActive ? '' : checked='checked' # disabled='disabled' />")
.Filterable(ftb => ftb.Cell(cell => cell.Operator("Is equal to")))
.Width(100);
columns.Bound(c => c.Name)
.Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")))
.Width(350);
columns.Bound(c => c.Address)
.Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")))
.Width(250);
columns.Bound(c => c.City)
.Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")))
.Width(150);
//...
//...
Make sure your Operators_Read action returns a JSON of IEnumerable<OperatorViewModel>.

Resources