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

Cant seem to apply any css override styles to the KendoGrid header

2 Answers 1623 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Cedric Gaines
Top achievements
Rank 2
Cedric Gaines asked on 18 Oct 2017, 08:35 PM

Maybe I'm overlooking something easy, but I can't seem to simply change the background color of my kendo grid header.

 

This is what I have, (it everything runs, but the base theme never changes)... (no centering, no bg color change).  What am I missing?

CSS

.k-header{
text-align: center;
background-color: #ff0099;
}

 

JS

$("#agencyListGrid").kendoGrid({
columns: [{
field: "agencyName",
title: "Agency"
},
{
field: "agencyID",
title: "View",
width: 100
},
{
field: "agencyID",
title: "Archive",
width: 100
}],
dataSource: {
data: this.agencyList.agencies,
pageSize: 15
},
height: 500,
pageable: {
pageSizes: true,
buttonCount: 5
}
});

2 Answers, 1 is accepted

Sort by
0
Accepted
Preslav
Telerik team
answered on 19 Oct 2017, 09:19 AM
Hello Cedric,

A possible solution to achieve the desired result might be using a CSS code similar to this one:

<style>
  .k-grid-header th.k-header{
    text-align: center;
    background-color: #ff0099;
  }
</style>

For a runnable example, check my testing Dojo: http://dojo.telerik.com/ULUDe

Additionally, if you are interested in my workflow how I am finding the required CSS selectors, I recorded a short video for your reference:
I hope this helps.
 

Regards,
Preslav
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Cedric Gaines
Top achievements
Rank 2
answered on 19 Oct 2017, 05:33 PM

Awesome, this helped me A LOT!!!

Thanks!

Tags
Grid
Asked by
Cedric Gaines
Top achievements
Rank 2
Answers by
Preslav
Telerik team
Cedric Gaines
Top achievements
Rank 2
Share this question
or