1. overwrite the displayoption () method under the form data source ();
2. overwrite the data source write () method: after super, write gridcolours_ds.cleardisplayoption (gridcolours );
The key points are: affectedelementsbycontrol () method.
Public void displayoption (Common _ record, formrowdisplayoption _ options)
{
Gridcolours gridcolourslocal = _ record;
;
Super (_ record, _ options );
// If highlight flag is set, then give the entire row a black background/white text
If (gridcolourslocal. highlight) // highlight is a field. When it is selected, it is yellow
{< br> _ options. backcolor (winapi: rgb2int (255,255, 0); // yellow
}< br> else
{< br> If (gridcolourslocal. requesteddate gridcolourslocal. requesteddate)
{< br> _ options. backcolor (winapi: rgb2int (255, 0, 0); // red
_ options. textcolor (winapi: rgb2int (255,255,255); // white text
If (gridcolourslocal. requesteddate {< br> // applies only to the requesteddate field on the grid
_ options. affectedelementsbycontrol (grid_requesteddate.id (); // This field is important. specify that only the columns in the grid are affected.
}
If (gridcolourslocal. confirmeddate> gridcolourslocal. requesteddate)
{< br> // applies only to the requesteddate field on the grid
_ options. affectedelementsbycontrol (grid_confirmeddate.id (); // same as above. If not, the entire row is colored.
}< BR >}