or
Html.Telerik().Grid<Predlogenie>().Name("Orders_<#= ZaprosId #>").DataKeys(keys =>{ keys.Add(p => p.PredlogenieId);}).Columns(columns =>{ columns.Bound(o => o.Predlogau).Width(200).Title("Предлогаю"); columns.Bound(o => o.DateIn).Title("Заезд").Width(100); columns.Bound(o => o.DateOut).Title("Выезд").Width(100); columns.Bound(o => o.Comment).Title("Комментарий"); columns.Command(commands => { commands.Edit().ButtonType(GridButtonType.Image); commands.Delete().ButtonType(GridButtonType.Image); }).Width(100);}).ToolBar(commands => commands.Insert().ButtonType(GridButtonType.Text).ImageHtmlAttributes(new { style = "margin-left:0" })) .DataBinding(dataBinding => dataBinding.Ajax() .Select("_OrdersForEmployeeDetailsAjax", "Home", new { id = "<#= ZaprosId #>" }) .Insert("_InsertAjaxEditing", "Home") .Update("_SaveAjaxEditing", "Home") .Delete("_DeleteAjaxEditing", "Home")).Pageable().Editable(editing => editing.Mode(GridEditMode.InForm).InsertRowPosition(GridInsertRowPosition.Top)).Sortable().Filterable().ToHtmlString());@(Html.Kendo().Grid<CPSkla.Models.GlobalProperties>().Name("GlobalProperties") .Columns(columns => { columns.Bound(p => p.Id).Hidden(); columns.Bound(p => p.Name); columns.Bound(p => p.Value); columns.Command(command => command.Destroy()); }) .DataSource(dataSource => dataSource.Ajax().Batch(true) .Model(model => model.Id(p => p.Id)) .Create("GlobalProperty_Create", "Admin") .Read("GlobalProperty_Read", "Admin") .Update("GlobalProperty_Editing_Update", "Admin") .Destroy("GlobalProperty_Editing_Destroy", "Admin") ) .ToolBar(toolbar => { toolbar.Create(); toolbar.Save(); }) .Editable(editable => editable.Mode(GridEditMode.InCell)))public ActionResult GlobalProperty_Create(List<GlobalProperties> models) { using (var db = new CPSkla.Models.CPSklaEntitiesCalculation()) { foreach (GlobalProperties model in models) { db.GlobalProperties.Add(model); db.SaveChanges(); } } return View(GetViewResult()); }@(Html.Kendo().DropDownListFor(m => m.CardPayment.State) .OptionLabel("Select state...") .BindTo(new SelectList(Model.States, "Abbreviation", "Name")) .DataTextField("Text") .DataValueField("Value") .HtmlAttributes(new { value = Model.CardPayment.State }) )<span tabindex="0" style="" unselectable="on" class="k-widget k-dropdown k-header"><span unselectable="on" class="k-dropdown-wrap k-state-default"><span unselectable="on" class="k-input">Select state...</span><span class="k-select"><span class="k-icon k-i-arrow-s">select</span></span></span><input id="CardPayment_State" name="CardPayment.State" type="text" value="" data-role="dropdownlist" style="display: none; "></span><input data-val="true" data-val-required="You must enter the billing state for the card." id="CardPayment_State" name="CardPayment.State" type="text" value="">[Display(Name = "State")][Required(ErrorMessage = "You must enter the billing state for the card.")][DataMember]public string State { get; set; }<div class="row"> <span class="editor-label"> @Html.LabelFor(model => model.Categorie, true, true) </span><span class="editor-field"> @(Html.Kendo().DropDownListFor(model => model.IdCategorie) .Name("CategorieDropDown") .DataTextField("Nom") .DataValueField("IdCategorie") .OptionLabel("Sélectionner une catégorie") .DataSource(source => { source.Read(read => { read.Action("GetAllCategories", "Article"); }).ServerFiltering(true); }) .HtmlAttributes(new { style = "width:250px" }) ) </span> </div> <div class="row"> <span class="editor-label"> @Html.LabelFor(model => model.SousCategorie, true, true) </span><span class="editor-field"> @(Html.Kendo().DropDownListFor(model => model.IdSousCategorie) .Name("SousCategorieDropDown") .DataTextField("Nom") .DataValueField("IdCategorie") .DataSource(source => { source.Read(read => { read.Action("GetAllSousCategories", "Article") .Data("filterCategorie"); }) .ServerFiltering(true); }) .OptionLabel("Sélectionner une sous catégorie") .Enable(false) .AutoBind(false) .CascadeFrom("CategorieDropDown") .HtmlAttributes(new { style = "width:250px" }) ) <script> function filterCategorie() { return { idCategorie: $("#CategorieDropDown").val() }; } </script> </span> </div>public
class UserModel
{
public
IEnumerable<RoleModel> RoleModels { get; set; }
}
public
class RoleModel
{
public int Id { get; set; }
public string Name { get; set; }
public bool InRole { get; set; }
}
.Name(
"Grid")
.Editable(editable => {
editable.Mode(
GridEditMode.PopUp).TemplateName("UserEditor"); })
.Columns(columns =>
{
columns.Bound(u => u.Name);
columns.Command(command => {
command.Edit();
})
.DataSource(dataSource => dataSource
.Ajax()
.Model(model => model.Id(m => m.Id))
.ServerOperation(
false)
.Read(read => read.Data(
"additional_data").Action("User_Read", "User"))
.Update(update=>update.Action("User_Update", "User"))
)
@Html.EditorFor(m => m.Name)
@Model.RoleModels.Count()
@Html.EditorFor(m => m.RoleModels,
"UserRoleEditor")
Editing_Create
Editing_Update
Editing_Destroy
I am attaching a sample code for the same.
Regards,
Nandan
Please find the Updated attached file