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

Removing selected row color change css style

3 Answers 1165 Views
Grid
This is a migrated thread and some comments may be shown as answers.
habeeb
Top achievements
Rank 1
habeeb asked on 05 May 2016, 05:41 AM

 

I am using Kendo UI Grid

@(Html.Kendo().Grid<SomeViewModel>()
 .Name("SomeGrid")
 .Columns(columns =>
 {
        columns.Bound(p => p.Id);
 })
 .Events(e => e.DataBound("onDataBound"))
 .Selectable(selectable => selectable.Enabled(true).Mode(GridSelectionMode.Single).Type(GridSelectionType.Row))
    .Scrollable()
 .Filterable()
    .DataSource(dataSource => dataSource
 .Ajax()
 .Read(...)
 )
 )

When the row is selected the color changes to orange. How do I remove the css style performing this color change. In other words when row is selected I don't want any color changing.

 

 

 

3 Answers, 1 is accepted

Sort by
0
habeeb
Top achievements
Rank 1
answered on 06 May 2016, 09:41 PM

This fixed it.

 

.k-grid .k-state-selected {
    background-color: #ffffff !important;
    color: #000000;
}
 
.k-grid .k-alt.k-state-selected {
    background-color: #f1f1f1 !important;
    color: #000000;
}

0
habeeb
Top achievements
Rank 1
answered on 06 May 2016, 09:41 PM

 

.k-grid .k-state-selected {
    background-color: #ffffff !important;
    color: #000000;
}
 
.k-grid .k-alt.k-state-selected {
    background-color: #f1f1f1 !important;
    color: #000000;
}

0
Daniel
Telerik team
answered on 09 May 2016, 07:37 AM
Hello Habeeb,

Instead of using important clause (not recommended) I would suggest that you use a selector with a higher specificity. For example:
<style type="text/css">
    div.k-grid .k-selectable tr.k-state-selected {
        background-color: #ff6a00;
    }
</style>

Regards,
Daniel
Telerik
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
habeeb
Top achievements
Rank 1
Answers by
habeeb
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or