Component in the header

Hello !

i have a gridcomponent in reactjs and i want to be able to add a checkbox in the header.
So in the header of each column, i will have the textheader and 

How can i acheive that ?

gridcomponent in ej2-react-grids

1 Reply 1 reply marked as answer

TS Thiyagu Subramani Syncfusion Team April 13, 2021 12:37 PM UTC

  
Hi Frédéric, 

Thanks for contacting Syncfusion support. 
To achieve your requirement we suggest you to use headerTemplate property for the required column. Using headerTemplate property you can customize the header element and in this demo the checkbox component is rendered for CustomerName field header. 
Please refer the below code example:  
gridTemplate(props) { 
return (<div id='default'> 
<CheckBoxComponent checked={true} label='Customer Name'  id="name"  /> 
</div>); 
<ColumnDirective field='CustomerName' . . . .  headerTemplate={this.template}></ColumnDirective> 
 
 
Please get back to us, if you need any further assistance. 
Regards, 
Thiyagu S 


Marked as answer
Loader.
Up arrow icon