Hi Aravind,
Greetings from Syncfusion support
From your update, we could see that you like to display the sorting icons in the initial render of Grid. Based on your query we have prepared a sample and achieved your requirement by adding custom class in the header by using headerCellInfo event of Grid.
In this sample, we have displayed the sorting icon in the header in the initial render, once you start performing the sorting the default Ascending/Descending icon will be displayed. When the column turns to initial state, we have displayed our customized sorting icon. Please refer the below code example and sample for reference.
|
<style>
.e-grid .customicon .e-sortfilterdiv:not(.e-icon-ascending):not(.e-icon-descending)::before {
content: "\e890"; //here you can display the icon as you want
font-size: .9em;
}
</style>
|
|
Index.js
export class Sorting extends SampleBase {
constructor() {
super(...arguments);
}
headerCellInfo(args) {
args.node.classList.add('customicon'); //add custom css
}
render() {
return (<div className='control-pane'>
<div className='control-section'>
<GridComponent dataSource={data} headerCellInfo={this.headerCellInfo.bind(this)} allowPaging={true} allowSorting={true} pageSettings={{ pageCount: 5 }}>
<ColumnsDirective>
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
</ColumnsDirective>
<Inject services={[Page, Sort]}/>
</GridComponent>
</div>
</div>);
}
} |
Screenshot:
Regards,
Rajapandi R