How to colorize Rows In Grid With Different colors using X++ in AX 2009?
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 :
public void displayOption(Common _record, FormRowDisplayOption _options)
{
if (_record.(fieldnum(MBST_PAYMENTS_HDR,POST_FLAG))=="YES")
{
_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
*This post is locked for comments