web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

paint records in different colors

(0) ShareShare
ReportReport
Posted on by 942

Hello everyone,

I'd like my form records to be painted in different colors depending on the records values in the grid. What is the best place for such change? init() on form datasource? What is the best approach?

Thanks.

I have the same question (0)
  • Verified answer
    Mariano Gracia Profile Picture
    on at
    RE: paint records in different colors

    use the form data source displayOption method, it has two parameters, the first one is the record, the second one is a FormRowDisplayOption wich you can use to change the back color based on the values of the first parameter

  • Suggested answer
    ergun sahin Profile Picture
    8,824 Moderator on at
    RE: paint records in different colors

    I haven't tested it, but if I'm not mistaken, we cannot use grid color in d365fo.

    With htmlviewer, the table can be created and painted manually, but I'm not sure if it's worth it.

    Instead, an field can be added to help visually perceive it.

  • Verified answer
    ergun sahin Profile Picture
    8,824 Moderator on at
    RE: paint records in different colors

    I came across an example below. I think my information is a bit old

    d365technext.blogspot.com/.../gridlist-row-color-change-using-method.html

  • huijij Profile Picture
    19,811 on at
    RE: paint records in different colors

    Hi Azat,

    As mentioned,you can add colors to a form control of a standard or custom form by using event handler method “OnDisplayOptionInitialize“ :

    docs.microsoft.com/.../specify-color-font-background-controls

    allaboutdynamic.com/.../

    regards

  • dark_knight Profile Picture
    942 on at
    RE: paint records in different colors

    form data source displayOption method worked like a charm for me. Thanks for your answers.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,100

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 890 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 633 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans