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

Is it possible to customise the selected column header in the grid?

2 Answers 980 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 02 Oct 2019, 07:34 AM

I have added a selected column as per the example in the grid documentation.  By defaul the Grid renders a checkbox to perform a select All and Deselect All.  I wonder if it is possible to customise the rendered header to display something else, 2 buttons for example.

The usecase here is there are rows in my data that I don't allow to be selected.  The problem is that when at least one row in the grid is not selected, the header checkbox will not be checked and clicking on it will keep on trying to perform a select All.

I know I can use state to hold the current status of select All or not, but the checkbox will always remain unticked in this situation and the user will be confused.

2 Answers, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 02 Oct 2019, 08:14 AM

Hello, Mark,

This can be done using the headerCell property of the column:

https://www.telerik.com/kendo-react-ui/components/grid/api/GridColumnProps/#toc-headercell

This is an example:

https://stackblitz.com/edit/react-kw1ysg?file=app/main.jsx

As for the selection of the select all checkbox, its checked and unchecked state is determined by the value passed to the "headerSelectionValue" prop. Which means that it may appear as  selected even if not all are selected:

https://www.telerik.com/kendo-react-ui/components/grid/api/GridColumnProps/#toc-headerselectionvalue

I hope this is helpful.

Regards,
Stefan
Progress 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
0
Mark
Top achievements
Rank 1
answered on 02 Oct 2019, 08:48 AM

Thanks,

That's what I was looking for

Tags
General Discussions
Asked by
Mark
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Mark
Top achievements
Rank 1
Share this question
or