Unplanned
Last Updated: 18 Mar 2021 17:19 by ADMIN
Michael
Created on: 06 Oct 2020 17:14
Category: Grid
Type: Feature Request
15
Set CSS class to the header cell of the column

I want to customize the appearance of the header of a certain column, and a bit of CSS backgrounds could help, but I can't do this with the HeaderTemplate alone, nor with content in it because of the padding the cells have.

So, I would like the ability to set the CSS class of the header cell of the column.

2 comments
ADMIN
Lachezar Georgiev
Posted on: 18 Mar 2021 17:19

Hello Jason,

Let me address your questions in order:

Hiding columns in the Grid

Considering this ticket and your comment in the thread for "Conditional row and cell class for styling" I think what your application needs is a way to hide columns in the Grid on small devices. If that is the case,  the way to accomplish this is not by using CSS. The Grid offers functionality to hide its columns. It was added as a Feature Request, which has been completed. You can view it here. You might also find my colleague's (Marin Bratanov) from March 18th which elaborates on the new MediaQuery component that will ship with our 2.23.0 release.

Bootstrap classes

The bootstrap classes that you mentioned are tools which are not suitable for the use case of hiding the Grid columns. 

Add CSS class to the header of the column

As for this Feature Request, I see that you have already voted for it. Based on the number of votes and other factors, feature requests might get pulled to our backlog and eventually get released in the future.

Regards,
Lachezar Georgiev
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/.

Jason
Posted on: 16 Mar 2021 19:35

We need to be able to define the css class in the TH and TD as well. In our case we use Bootstrap, which does a good job at responsive UI as long as we can add the appropriate classes.

I thought this feature was being implemented here, but it doesn't look like it: https://feedback.telerik.com/blazor/1456957-conditional-row-and-cell-class-for-styling

It would have saved us so much time to just been able to

<GridColumn class="d-none d-xl-block" />
or
<Template class="d-none d-xl-block"" />
or
<HeaderTemplate
class="d-none d-xl-block" />