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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set bold and italic in a cell data

Thread ID:

Created:

Updated:

Platform:

Replies:

149433 Nov 26,2019 09:38 AM UTC Nov 27,2019 01:24 PM UTC Angular - EJ 2 1
loading
Tags: TreeGrid
Nithin Benny
Asked On November 26, 2019 09:38 AM UTC

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

Farveen Sulthana Thameeztheen Basha [Syncfusion]
Replied On 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:- 
App.component.html 
<ejs-treegrid [dataSource]='data'  childMapping='subtasks' [treeColumnIndex]='1'allowPaging='true' [pageSettings]='pageSettings' [editSettings]='editSettings'  (queryCellInfo)="queryCellInfo($event)"
        <e-columns> 
            <e-column field='taskID' headerText='Task ID' width='120' textAlign='Right' isPrimaryKey='true' ></e-column> 
               .   .       
        
    </ejs-treegrid> 

App.component.ts 

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon