Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to customize the background color of selected of a Kendo UI Grid row

I am a Kendo UI newbie. In my Asp.Net MVC application I use Kendo UI Grid widget and and configure that Grid so user can select a Grid row like:

$("#gridSurvey").kendoGrid({
                dataSource: {
                    type: "json",
                    transport: {
                        read: {
                            url: "/MyController/GetItemList",  

                            ...
                selectable: "row",
                change: function(e)
                {
                    var entityGrid = $("#gridItems").data("kendoGrid");
                    _selectedItem = entityGrid.dataItem(entityGrid.select());

                },
                ...

By default, when user clicks on a row, the selected row of the selected Grid row is high-lighted with some built-in color. How can I customize/change that background color of that selected row to transparent or some other color? I prefer transparent background color. Please help. Thank you in advance.

like image 1000
Thomas.Benz Avatar asked Feb 18 '14 14:02

Thomas.Benz


People also ask

How do I change the background color of Kendo grid headers?

According to Kendo grid documentation, we are able to set the column's header attribute by using the headerAttributes: $("#grid"). kendoGrid({ columns: [{ field: "name", headerAttributes: { style: "text-align: right; font-size: 14px; color: red !

What is selectable in kendo grid?

Description. There are situations when you would like to enable the end user to select rows or cells in the grid table, and process data from them or make calculations based on this selection. The Kendo UI grid supports selection by specifying its configuration via its selectable attribute.


2 Answers

.k-grid td.k-state-selected:hover, .k-grid tr:hover {
    color: #fff;
    background-color: darkslategray;
}
like image 127
Gail Foad Avatar answered Oct 16 '22 05:10

Gail Foad


.k-grid .k-state-selected { background: blue; }
like image 39
CSharper Avatar answered Oct 16 '22 04:10

CSharper