Hello!I have a problem, where I try to insert color picker in grid
.CSHTML:
@(Html.Kendo().Grid(Model)
.Name("Grid")
.Columns(columns =>
{
columns.Bound(p => p.Id).Title(Resources.Resource.Id);
columns.Bound(p => p.Name).Title(Resources.Resource.Name);
columns.Bound(p => p.Text).Title(Resources.Resource.Text);
columns.Bound(p => p.Color).Title(Resources.Resource.Color)
.ClientTemplate("<div style='background-color: #: Color#;padding:10px; border: 1px solid black;'></div>")
.EditorTemplateName("Color");
columns.Bound(p => p.Description).Title(Resources.Resource.Description);
columns.Command(command => { command.Edit(); });
})
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Pageable()
.Sortable()
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Events(events => events.Error("error_handler"))
.Model(model =>
{
model.Id(m => m.Id);
model.Field(m => m.Id).Editable(false);
model.Field(m => m.Name).Editable(false);
})
.Read(read => read.Action("Read", "OrderStatus"))
.Update(update => update.Action("Update", "OrderStatus"))
)
)
Color Editor Template:
@model string
@(Html.Kendo().ColorPickerFor(
m => m))
As a result i get any nonsence (1.jpg)
I want to get this(2.png)
Please, help me.