Changing color of selected row

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

    Posted 04 May 2016 Link to this post

    @(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, color changes to orange. How do I modify this behavior to not change to any color at all ?

     

  2. Ivan Danchev
    Admin
    Ivan Danchev avatar
    2089 posts

    Posted 05 May 2016 Link to this post

    Hello Habeeb,

    You can apply the following two CSS rules, which will set the background color to the selected row as it is in the Default skin, preventing the row from being colored in orange:
    .k-grid .k-state-selected  {
      background-color: #ffffff !important;
      color: #000000;
    }
     
    .k-grid .k-alt.k-state-selected {
      background-color: #f1f1f1 !important;
      color: #000000;
    }



    Regards,
    Ivan Danchev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. habeeb
    habeeb avatar
    8 posts
    Member since:
    Apr 2016

    Posted 05 May 2016 in reply to Ivan Danchev Link to this post

    Thanks Ivan.

     

     

Back to Top