Removing selected row color change css style

4 posts, 0 answers
  1. habeeb
    habeeb avatar
    8 posts
    Member since:
    Apr 2016

    Posted 05 May Link to this post

     

    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.

     

     

     

  2. habeeb
    habeeb avatar
    8 posts
    Member since:
    Apr 2016

    Posted 06 May in reply to habeeb Link to this post

    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;
    }

  3. UI for ASP.NET MVC is VS 2017 Ready
  4. habeeb
    habeeb avatar
    8 posts
    Member since:
    Apr 2016

    Posted 06 May in reply to habeeb Link to this post

     

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

  5. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 09 May Link to this post

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