Grid Display colors and fonts?

1 Answer 27 Views
Grid
Deasun
Top achievements
Rank 3
Iron
Iron
Iron
Deasun asked on 09 Sep 2022, 04:51 PM

I would like in C# code behind, to set the Header background color and Font Color & Bold it.

How can I do that?

Something like:

Grid.Columns.Header.BAckground = NAvy

Grid.Columns.Header.font.color = White

Grid.Columns.Header.font.bold = true

Also want to do a alternate row coloring setup. How'd I do that?

 

Is there a render event I can use?

 

Thanks

Deasun

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 13 Sep 2022, 01:15 PM

Hi Deasun,

To style the Grid header cells, set custom CSS classes via the HeaderCell parameter of the GridColumn. We don't support inline styles at this point.

The Grid applies alternate row backgrounds by default. If you want to further customize the looks of rows and cells, use the OnRowRender and OnCellRender events. They allow you to set custom row and cell CSS classes.

To apply random custom styles, including font changes, check this KB article about reducing the Grid font size with custom CSS.

Regards,
Dimo
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Deasun
Top achievements
Rank 3
Iron
Iron
Iron
Answers by
Dimo
Telerik team
Share this question
or