Wednesday, 30 April 2014

How to coloring rows in Grid of List page in AX 2012

Solution:
You need in sometimes to colorize specific rows with different color to do anything in your business rules to do this :
 1-  Go to the data source of  your form 
2- Choose that data source is used by the grid that you want to color it 
3- write click on the override method and select displayOption  method and put the following code inside :
In my example i took MainAccountListpage 
 public void displayOption(Common _record, FormRowDisplayOption _options)
{
                    if ((_record.(fieldNum(MainAccount,Type)) ==DimensionLedgerAccountType::Total)
                    {
                                        _options.backColor(WinAPI::RGB2int(161,161,255));
                    }
                    super(_record, _options);
}
 Note : This code will coloring your grid by the colors inside this function WinAPI::RGB2int(161,161,255) when you  change the numbers inside the function you will get more colors 
Original Link:

No comments:

Post a Comment