or
@(Html.Kendo().DropDownList()
.Name("EnvironmentID")
.DataValueField("EnvironmentID")
.DataTextField("Name")
.DataSource(d =>
{
d.Read(r => r.Action("GetEnvironmentsJsonResult", "Home").Data("getCustomerID()")).ServerFiltering(true);
}
)
.OptionLabel("Environment")
)
function getCustomerID() {
var row = $(event.currentTarget).closest("tr");
var grid = $(event.currentTarget).closest("[data-role=grid]").data("kendoGrid");
var dataItem = grid.dataItem(row);
return { customerID: dataItem.CustomerID };
}
columns.Bound(m => m.PatientName).Title("Patient Name").Width(170).Filterable(f => f.Cell(c => c.InputWidth(130)));
@(Html.Kendo().Grid<
BreezeU.DAL.UserFile
>()
.Name("Grid")
.Columns(columns =>
{
columns.Bound(p => p.Id).Title("Id").Visible(false);
columns.Bound(p => p.Title).Title("Name");
columns.Bound(p => p.LastUpdatedOn).Title("ModifiedDate").Format("{0:MM/dd/yyyy}").Width(140);
columns.Command(commands =>
{
commands.Destroy(); // The "destroy" command removes data items
}).Width(120);
})
.Events(ev => ev.Save(@"function(e){setTimeout(function(){$('#Grid').data('kendoGrid').dataSource.sync()})}"))
.Editable(editable => editable.Mode(GridEditMode.InCell)) // Use inline editing mode
.Filterable()
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
model.Id(p => p.Id); // Specify the property which is the unique identifier of the model
model.Field(p => p.Id).Editable(false); // Make the Id property not editable
model.Field(p => p.LastUpdatedOn).Editable(false); // Make the date property not editable
})
.PageSize(20)
.ServerOperation(false)
.Read(read => read.Action("read", "files").Data("getAntiForgery")) // Set the action method which will return the data in JSON format
.Update(update => update.Action("update", "files").Data("getAntiForgery")) // Action invoked when the user saves an updated data item
.Destroy(destroy => destroy.Action("delete", "files").Data("getAntiForgery")) // Action invoked when the user removes a data item
)
.Pageable() // Enable paging
.Sortable() // Enable sorting
)