This question is locked. New answers and comments are not allowed.
Hi,
I am using mvc kendo ui grid:
@(Html.Kendo().Grid<PortalUser>(Model.GetUsers())
.Name("Grid")
.Columns(columns =>
{
columns.Bound(p => p.ID).Width(200);
columns.Bound(p => p.UserName).Width(250);
columns.Bound(p => p.Password).Visible(false);
columns.Bound(p => p.Email).Width(250);
columns.Bound(p => p.Role.Name).Width(200).Title("Role");
columns.Bound(p => p.Comment).Width(300);
columns.Bound(p => p.IsLockedOut).Title("Locked").Width(100);
columns.Command(command => { command.Edit(); }).Width(100);
columns.Command(command => { command.Destroy(); }).Width(100);
})
.ToolBar(toolbar => toolbar.Create())
.Editable(editable => editable.Mode(GridEditMode.PopUp))
.Pageable()
.Sortable()
.Scrollable()
.Filterable()
.Selectable(selectable => selectable.Mode(GridSelectionMode.Single))
.DataSource(dataSource => dataSource
.Ajax()
.Batch(false)
.ServerOperation(false)
.PageSize(50)
.Create(update => update.Action("Users_Create", "Membership"))
.Read(read => read.Action("Users_Read", "Membership").Data("FilterUsers"))
.Destroy(update => update.Action("Users_Delete", "Membership"))
.Update(update => update.Action("Users_Edit", "Membership"))
.Model(model =>
{
model.Id(m => m.ID);
model.Field(m => m.ID).DefaultValue(new Guid());
model.Field(m => m.Role).DefaultValue(new PortalRole { RoleID = Guid.NewGuid(), Name = "no role" });
})
)
.HtmlAttributes(new { style = "height:500px" })
)
I want the Role field to display as dropdown in the popup editor. So i have created a template file called RoleEditor.cshtml in Views\Shared\EditorTemplates.
I have also added the decoration attribute
[UIHint("RoleEditor")]
public PortalRole Role { get; set; }
to the model class
I have followed all the steps given in your documentation:
http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/editor-template
and yet it does not work.
I am using mvc kendo ui grid:
@(Html.Kendo().Grid<PortalUser>(Model.GetUsers())
.Name("Grid")
.Columns(columns =>
{
columns.Bound(p => p.ID).Width(200);
columns.Bound(p => p.UserName).Width(250);
columns.Bound(p => p.Password).Visible(false);
columns.Bound(p => p.Email).Width(250);
columns.Bound(p => p.Role.Name).Width(200).Title("Role");
columns.Bound(p => p.Comment).Width(300);
columns.Bound(p => p.IsLockedOut).Title("Locked").Width(100);
columns.Command(command => { command.Edit(); }).Width(100);
columns.Command(command => { command.Destroy(); }).Width(100);
})
.ToolBar(toolbar => toolbar.Create())
.Editable(editable => editable.Mode(GridEditMode.PopUp))
.Pageable()
.Sortable()
.Scrollable()
.Filterable()
.Selectable(selectable => selectable.Mode(GridSelectionMode.Single))
.DataSource(dataSource => dataSource
.Ajax()
.Batch(false)
.ServerOperation(false)
.PageSize(50)
.Create(update => update.Action("Users_Create", "Membership"))
.Read(read => read.Action("Users_Read", "Membership").Data("FilterUsers"))
.Destroy(update => update.Action("Users_Delete", "Membership"))
.Update(update => update.Action("Users_Edit", "Membership"))
.Model(model =>
{
model.Id(m => m.ID);
model.Field(m => m.ID).DefaultValue(new Guid());
model.Field(m => m.Role).DefaultValue(new PortalRole { RoleID = Guid.NewGuid(), Name = "no role" });
})
)
.HtmlAttributes(new { style = "height:500px" })
)
I want the Role field to display as dropdown in the popup editor. So i have created a template file called RoleEditor.cshtml in Views\Shared\EditorTemplates.
I have also added the decoration attribute
[UIHint("RoleEditor")]
public PortalRole Role { get; set; }
to the model class
I have followed all the steps given in your documentation:
http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/editor-template
and yet it does not work.