We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to set bold and italic in a cell data

I need to set bold and italic in a cell data in treegrid based on some conditions.

1 Reply

FS Farveen Sulthana Thameeztheen Basha Syncfusion Team November 27, 2019 01:24 PM UTC

Hi Nithin, 

Thanks for contacting Syncfusion Support. 

We have checked your query and we have achieved your requirement using queryCellInfo event of the TreeGrid. In the queryCellInfo event, we can get the corresponding cell data and customize the cells based on condition. 

Refer to the code example:- 
<ejs-treegrid [dataSource]='data'  childMapping='subtasks' [treeColumnIndex]='1'allowPaging='true' [pageSettings]='pageSettings' [editSettings]='editSettings'  (queryCellInfo)="queryCellInfo($event)"
            <e-column field='taskID' headerText='Task ID' width='120' textAlign='Right' isPrimaryKey='true' ></e-column> 
               .   .       


queryCellInfo(args: QueryCellInfoEventArgs): void { 
       if (args.data['duration'] == 0 ) { 
             args.cell.style.fontWeight = 'bold'; 
             args.cell.style.fontStyle = 'italic' 

Please get back to us if

Live Chat Icon For mobile
Up arrow icon