Controlling grid line colors
Views (766)
Can see some folks have found the DisplayOptionInitialize event, still they are in doubt on how to control the displayOption settings based on the selected line.
Here is the solution:
Here is the solution:
X++:
[FormDataSourceEventHandler(formDataSourceStr(Form1, SalesTable), FormDataSourceEventType::DisplayOptionInitialize)]
public static void SalesTable_OnDisplayOptionInitialize(FormDataSource sender, FormDataSourceEventArgs e)
{
FormDataSourceDisplayOptionInitializeEventArgs args = e as FormDataSourceDisplayOptionInitializeEventArgs;
RecId currentRecId = args.record().RecId;
int rgbValue = 255 - (20 * (currentRecId mod 2));
args.displayOption().backColor(WinAPI::RGB2int(rgbValue, rgbValue, rgbValue));
}
This was originally posted here.
*This post is locked for comments