Table color field background color

Source: Internet
Author: User

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 >}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.