This is a migrated thread and some comments may be shown as answers.

Grid and ColorPicker

3 Answers 272 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alexey
Top achievements
Rank 1
Alexey asked on 18 Jul 2016, 01:13 PM

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.

any nonsense

3 Answers, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 20 Jul 2016, 10:07 AM
Hello Alexey,

A fully runnable sample is available in this dojo - http://jsfiddle.net/OnaBai/6XJV6/

Regards,
Danail Vasilev
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Alexey
Top achievements
Rank 1
answered on 20 Jul 2016, 02:47 PM
Thanks, I see this sample, but situation is not changed.
If I insert color picker not in the table it works. 
0
Danail Vasilev
Telerik team
answered on 21 Jul 2016, 10:50 AM
Hello Alexey,

I am not sure if I correctly understand the problematic behavior. Could you please reproduce the issue with the provided sample and then send it back to us for further investigation?

Regards,
Danail Vasilev
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Alexey
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Alexey
Top achievements
Rank 1
Share this question
or