Hi,
I have the grid below and I have added a dropdown list in one of the cells. What I want to do is for each item in the dropdown list I want to set a color.
I.e. item 1 has a blue background, item 2 has a green background etc.
Also I want the selected items background color to also be the same as the item they have selected.
Any Ideas on what I can do to achieve the above?
Below is the grid I am working with:
@using System.Collections.Generic;
@model IEnumerable<TelerikChecklist.Models.ProductViewModel>
@(Html.Kendo().Grid(Model)
.Name("gridDropDown")
.Columns(columns =>
{
columns.Bound(p => p.ProductName);
columns.ForeignKey(p => p.CategoryID, (System.Collections.IEnumerable)ViewData["categories"], "CategoryID", "CategoryName")
.Title("Category").Width(150);
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Pageable()
.Scrollable()
.HtmlAttributes(new { style = "height:250px;" })
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true)
.PageSize(20)
.ServerOperation(false)
.Events(events => events.Error("errorHandler"))
.Model(model =>
{
model.Id(p => p.ProductID);
model.Field(p => p.ProductID).Editable(false);
model.Field(p => p.CategoryID).DefaultValue(1);
})
.Read(read => read.Action("ForeignKeyColumn_Read", "Home"))
.Update(update => update.Action("ForeignKeyColumn_Update", "Home")).Events(e => e.Change("Category"))
.Create(create => create.Action("ForeignKeyColumn_Create", "Home"))
.Destroy(destroy => destroy.Action("ForeignKeyColumn_Destroy", "Home"))
)
)
I have the grid below and I have added a dropdown list in one of the cells. What I want to do is for each item in the dropdown list I want to set a color.
I.e. item 1 has a blue background, item 2 has a green background etc.
Also I want the selected items background color to also be the same as the item they have selected.
Any Ideas on what I can do to achieve the above?
Below is the grid I am working with:
@using System.Collections.Generic;
@model IEnumerable<TelerikChecklist.Models.ProductViewModel>
@(Html.Kendo().Grid(Model)
.Name("gridDropDown")
.Columns(columns =>
{
columns.Bound(p => p.ProductName);
columns.ForeignKey(p => p.CategoryID, (System.Collections.IEnumerable)ViewData["categories"], "CategoryID", "CategoryName")
.Title("Category").Width(150);
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Pageable()
.Scrollable()
.HtmlAttributes(new { style = "height:250px;" })
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true)
.PageSize(20)
.ServerOperation(false)
.Events(events => events.Error("errorHandler"))
.Model(model =>
{
model.Id(p => p.ProductID);
model.Field(p => p.ProductID).Editable(false);
model.Field(p => p.CategoryID).DefaultValue(1);
})
.Read(read => read.Action("ForeignKeyColumn_Read", "Home"))
.Update(update => update.Action("ForeignKeyColumn_Update", "Home")).Events(e => e.Change("Category"))
.Create(create => create.Action("ForeignKeyColumn_Create", "Home"))
.Destroy(destroy => destroy.Action("ForeignKeyColumn_Destroy", "Home"))
)
)