I have implemented a DrawFilter which causes my cells with errors to have their backcolor drawn as red. The cells which have errors should have red backgrounds with black text. However, it seems that the Active Row color is "laying over" the actual cell and is semi-transparent, causing my cells actual color to be reddish orange, and the text to be a grey orange. How can I stop the ActiveRow's selection color from being drawn on top of my cell? And even on the non-error cells, I want my text to be black, not grey orange.Here is my DrawElement implementation (executing upon the CellUIElements DrawPhase.BeforeDrawBackColor):
AppearanceData appearanceData = new AppearanceData() { BackColor = Color.Red }; drawParams.DrawBackColor(ref appearanceData, drawParams.Element.Rect, drawParams.InvalidRect, true); return true;
To be clear, I don't want the active row appearance to be displayed at all within cells which have errors. I am on vs. 7.2 and don't have access to the ActiveAppearance and ActiveAppearancesEnabled properties.
Hm. SelectionOverlay wasn't added until v9.2. So if you re using v7.2 that can't be it. But there isn't any other transparent overlay drawing in the grid that I know of.
So that means you are either drawing this yourself using the DrawFilter, or else you are using an Appearance somewhere that is setting the AlphaLevel so that some part of the grid are semi-transparent. Perhaps you made the cells transparent or partially transparent and what you are seeing here is the cell color combining with the row color behind it.
Thanks for your reply Mike. We are using a combination of .isl and setting properties off of the Grid's DisplayLayout. I'm not finding any of the SelectionOverlay properties on this.DisplayLayout or this.DisplayLayout.Override.I've seen others accessing SelectionOverlay* off of thisGrid.GridSettings, but I have been unable to find GridSettings off of my grid object either.This leads me to the .isl files. I have opened the .isl's in np++ and searched for selection overlay, but did not find any results. I also opened it in AppStylist, but wasn't able to find it referenced there either (on the cell or row roles, or grid component role (looking in the "UltraGrid-specific Properties" box)). It is of note that in the AppStylist, the active row doesn't seem to have SelectionOverlay enabled as the preview of the grid shows the active row as the desired orange/yellow, and the text still remaining completely black across the whole row (what I want). So maybe the problem isn't here.Admittedly, I'm a novice with these controls, so your help is appreciated =).
Your grid must be using the SelectionOverlay feature. This works like Excel where the selected rows are drawn using a semi-transparent color which is drawn on top of the row.
If you want a cell to be a specific color and not show the overlay, then you will have to turn this functionality off for the entire grid. There's no way to draw the overlay over some cells and not others.
Look for SelectionOverlay in your code, or if you are loading an isl, then you will need to turn this off in the isl using the grid's component role.