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

Custom CSs

Thread ID:

Created:

Updated:

Platform:

Replies:

144801 May 23,2019 12:29 PM UTC May 24,2019 12:46 PM UTC Angular - EJ 2 1
loading
Tags: TreeGrid
sunithra
Asked On May 23, 2019 12:29 PM UTC

Hi

In Treegrid Component need to apply the custom CSS. Could you please Let me know the solution as soon as possible .

Thanks in Advance 

Regards,

Sunithra.C

Farveen Sulthana Thameeztheen Basha [Syncfusion]
Replied On May 24, 2019 12:46 PM UTC

Hi Sunithra, 

Thanks for contacting Syncfusion Support. 

QUERY: Need to apply Custom CSS in TreeGrid 
 
In Syncfusion we have “Theme Studio” to customize new themes for our components. It supports TreeGrid Component. You can use this Theme Studio for customizing the TreeGrid. Please refer to the below link, 

Also please refer to the attached document to modify the TreeGrid appearance by overriding the default CSS of the TreeGrid.  

We have logged a task to create “how to section” for styling the TreeGrid Component in our Documentation Page. We will let you know once it is refreshed. 

In TreeGrid, we also have “cutomAttribute” API . Using this, the CSS styles and attributes of the content cells of a particular column can be customized. Please refer the below help documentation, 

You can customize the grid cells by adding a CSS class to the customAttribute property of the column. 


In app.style.css 

.e-attr { 
    background: #d7f0f4; 


    field: taskID, headerText: 'Task ID', customAttributes: {class: 'e-attr'}, width: '90' 


In the below example, we have customized the cells of OrderID and ShipCity columns. 


In app.component.ts 

import { Component, OnInit, ViewEncapsulation } from '@angular/core'; 
import { sampleData } from './datasource'; 

@Component({ 
    selector: 'app-root', 
    template: `<ejs-treegrid [dataSource]='data' height='300' [treeColumnIndex]='1' childMapping='subtasks' > 
        <e-columns> 
                    <e-column field='taskID' headerText='Task ID' [customAttributes]="{class: 'e-attr'}" 
                    textAlign='Right' width=90></e-column> 
                            -------------------------- 
        </e-columns> 
                </ejs-treegrid>`, 
                styleUrls: ['app.style.css'], 
                encapsulation: ViewEncapsulation.None, 

}) 
export class AppComponent implements OnInit { 
       ------------------ 

Please get back to us if you need any further assistance. 

Regards, 
Farveen sulthana T 


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