Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

change color List view (grid) with condition

(0) ShareShare
ReportReport
Posted on by

Hi All,

I'm trying to change row color of my list view (grid) by condition.

Any idea please?

  • Suggested answer
    CU13072322-0 Profile Picture
    on at
    change color List view (grid) with condition
    Color Grid for Microsoft Dynamics 365
     
    Hi, did you try Color Grid for Microsoft Dynamics 365, this is highly configurable solution, and you can apply almost any data conditions very similar we have in advanced find.
     
    Key Features include:
    • Any cell and row level colors.
    • Advanced find type conditions.
    • Font formatting 
    • Conditional emojis in cell
     
  • Arslan001 Profile Picture
    60 on at
    RE: change color List view (grid) with condition

    Dallen 

    Hello Dallen.

    I am looking to research and experiment with Scripts that would accomplish this on both CRM Views and CRM Dashboards. Have you been able to successfully implement this in Sandbox or Production? I would appreciate any help and direction on this.

    Thank you and Best Regards,

    Arslan

  • Dallen Profile Picture
    5 on at
    RE: change color List view (grid) with condition

    1. get rowid

    2. get the row element

    3. set the css

    var str = JSON.parse(rowData);

    var rowId = str.RowId;

    $("div[row-id='"+rowId+"']").css("background-color","green");

    $("div[row-id='"+rowId+"'] div span").css("color","white");

  • Arslan001 Profile Picture
    60 on at
    RE: change color List view (grid) with condition

    Hey Phuoc. I am interested in implementing this for our organization? just curious about how and why it is unsupported solution?

    Regards, Arslan

  • Community Member Profile Picture
    on at
    RE: change color List view (grid) with condition

    thank you Samira,

    but, when i implement your code the first choice disappeared from the list.

    maybe here i have a problem in the name of 'tr'.

    haw can i find it?

  • Suggested answer
    SamiraM Profile Picture
    587 on at
    RE: change color List view (grid) with condition

    Check My JS below:

    function showEventStatusNew(rowData, userLCID) {

       debugger;

       if (rowData == null || rowData == 'undefined') return;

       // read rowdata

       var str = JSON.parse(rowData);

       var coldata = str.new_statoevento_Value;

       var rowId = str.RowId;

       var opened = str.new_opened_Value;

       if (coldata == null || coldata == 'undefined' || coldata.length < 1) return;

       if (!opened) {

           switch (coldata) {

               case 2:

                   $("tr[oid='" + rowId + "']").css('fontWeight', 'bold');

                   //       $('span:contains("Attivo")').parent().parent().css('fontWeight', 'bold');

                   break;

               case 0:

                   $("tr[oid='" + rowId + "']").css('fontWeight', 'bold');

                   break;

               default:

                   break;

           }

       }

    }

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: change color List view (grid) with condition

    Hi,

    This is not supported solution to change the row color in Grid.

    try this solution: docs.microsoft.com/.../display-custom-icons-instead

  • meelamri Profile Picture
    13,216 User Group Leader on at
    RE: change color List view (grid) with condition

    I agree that this may work. However, this approach is not supported. Indeed, according to Microsoft, DOM manipulation is not supported.

  • Community Member Profile Picture
    on at
    RE: change color List view (grid) with condition

    Hi Mehdi,

    the best solution is with Js.

    @samira Mirza gave me an good link. but just i don't know how to find the 'td' in the JS proposed.

    arpitmscrmhunt.blogspot.com/.../dynamics-crm-dynamically-change-row.html

  • Suggested answer
    meelamri Profile Picture
    13,216 User Group Leader on at
    RE: change color List view (grid) with condition

    Hi,

    I don't think there is a supported way to implement your scenario. I suggest you look for or implement a PCF Control that meets your needs.

    Another approach would be to use custom icons on one of the columns of your grid. Indeed, this approach is supported..you can find the details of the implementation here: docs.microsoft.com/.../display-custom-icons-instead

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 671 Super User 2025 Season 1

#2
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 167 Super User 2025 Season 1

#3
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 138 Most Valuable Professional

Product updates

Dynamics 365 release plans