Grid and ColorPicker

4 posts, 0 answers
  1. Alexey
    Alexey avatar
    2 posts
    Member since:
    Jul 2016

    Posted 18 Jul Link to this post

    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
  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 20 Jul Link to this post

    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
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Alexey
    Alexey avatar
    2 posts
    Member since:
    Jul 2016

    Posted 20 Jul in reply to Danail Vasilev Link to this post

    Thanks, I see this sample, but situation is not changed.
    If I insert color picker not in the table it works. 
  5. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 21 Jul Link to this post

    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
Back to Top
UI for ASP.NET MVC is VS 2017 Ready