I’m using a grid to display mechanical testing requirements and test results. I would like to be able to set the background colour of individual rows … when not the active row … depending on the row state. For example, a shade of red for FAILED tests, and possibly green for OK results.
I’ve been having a look at available grid row settings using intellisense, but haven’t spotted anything obvious relating to colour control. Can anyone offer advice? I use the following code … provided through an earlier forum post … to set focus to the cell where data entry is required.
Any advice on this would still be appreciated. I know this must be possible, but I have had no luck at all provided from Google or Intellisense within Factory Studio.
I’ve stumbled on a basic method through the documentation covering dynamic cell colours in reports Now I just need to adapt it to my specific requirements.
As hoped … it wasn’t hard … just not immediately obvious …
Turns out that this method works … but doesn’t suit my application. The application will generally have a set of ‘shown’ rows which is greater than the number or rows visible within the grid.
I need to be able to set the colour of the row even if it is off the bottom of the visible grid, but this method appears to blow up if the index used is outside the visible range.
I’m after a simple method to specify the background colour for any grid ‘shown’ row, and also to return it to the original colour if/when the condition is reversed.
How hard can it be
Any advice will be really appreciated!
Can anyone tell me how to determine the default row background colours for the alternating grid rows.
I can do this … rather unreliably … by saving the background colours of the top two grid rows on a nominal first pass of the grid.
I think all my problems may be solved if I can simply obtain these colours from a system function.
I want to be able to set the data grid default row background colours like this …
but there don’t appear to be properties available within the TDataGridWindow class …