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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Style a row

Thread ID:





128626 Feb 1,2017 05:52 PM UTC Feb 2,2017 03:07 PM UTC Angular 3
Tags: ejGrid
Asked On February 1, 2017 05:52 PM UTC

I'm looking for a way to hook into the api and then tell which rows to use the default/alternate row theme?

Replied On February 1, 2017 06:30 PM UTC

Like this link but in Angular 2

Replied On February 1, 2017 06:30 PM UTC


Venkatesh Ayothi Raman [Syncfusion]
Replied On February 2, 2017 03:07 PM UTC

Hi Zack, 
Thanks for contacting Syncfusion support. 

We can also change the background-color for specific row in Angular 2 grid component using rowDataBound event in Grid. In this event, we can get the row details and row data for each single row. So, we can use this event and check the condition for change the back-ground color to specific row. Please refer to the code example and Help documentation for more information, 
Code example: 
<ej-grid #grid  [dataSource]="gridData" [allowPaging]="true"   (rowDataBound)= "rows($event)" > 
         . . . 
export class AppComponent { 
     . . . 
            var rowDetails = e.row; // Get the row 
            //check the condition for specific value 
            if(e.data.EmployeeID == 5) 
                rowDetails.css("background-color", "black").css("color", "white"); // change the BG color for specific rows 
        . . . 
Venkatesh Ayothiraman. 


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