In Appstylist I created a new style set. I chose to create the style set from scratch, not based on any existing ISL file and not using any themes. For a gridrow, when the row is active, I want the background color to be transparent. I specify this in my style set. The issue I'm having is that in my grid, I'm coloring specific cells programmatically based on certain conditions and the transparent background color is masking over the colors I've set programmtically. For instance, if a part in my parts list grid row has an issue, I color the part cell red. When the user goes a click on the row and makes it active, the red color goes away and becomes white. I really need to have the red color show through so that the user can still tell that the item has an issue when the row is active. In the application I'm working on, several columns in the row could have different colors based on certain conditions and the user loses this information when the row is clicked on. Setting the Selected state background color to transparent for the gridrow did not fix this issue either. Any suggestions?
Thanks!
Steve
Hi Steve,
When you color the cell red, you should also set the cell.SelectedAppearance - in addition to the cell.Appearance. That way, the cell will use the same color whether it is selected or not.
Hi Mike ... Thank you for the suggestion. It works when I'm selecting a number of rows using CTRL-Click or SHIFT-click. However, I'm still having the issue when I'm scrolling up and down through the grid and when I click directly on a single row. I think it might have to do with the difference between what is considered "Selected" and what is considered "Active" ... I looked for a similar setting for Active that exists for Selected (cell.SelectedAppearance), but I didn't find one. Is there a way to set the Appearance of the Active Row so that I can preserve my coloring logic?
Thanks again!
Hi Steve
No, there's no similar property for the Active row. Perhaps what you could do is turn off the ActiveRow / ActiveCellAppearance:
FAQ:How do I turn off the ActiveRowAppearance so that the active row in the grid does not appear selected.
Hi Mike ... I tried this as well and unfortunately it did not work. The color is still being hidden when the row is active. Any other thoughts/ideas?
A DrawFilter allows you to override or modify the painting of any UIElement within the grid. So yes, you could probably get around this using a DrawFilter.
If you want to explore DrawFilters, I recommend that you take a look in the Infragistics Knowledge Base and search for DrawFilter. You will find lots of articles and samples to help get you started. Also, get the Infragistics UIElementViewer Utility. This tool is invaluable when working with UIElements.
Thanks Mike for helping me out with this. I'm really new to the Infragistics tool set (you might have been able to tell). One of my colleagues thought maybe using Draw Filters could possibly solve this issue. What do you think? Will that help us in this case? Any feedback would be greatly appreciated.
Thanks,
Okay, it looks like the grid considers the ActiveRow Appearance to be a more specific state than the individual appearance on a cell. You can demonstrate this without using AppStylist by just setting the ActiveRowAppearance on the grid's DisplayLayout.Override to a color.
So it looks like there's no way around this.
Hi Mike ... I've attached a sample project that shows the problem. I've colored the first cell in the first row of the grid to be aqua. When the app comes up that first row is active and you can see by scrolling up and down that when the row is active the aqua color disappears and is replaced by white. I've included the style set I've been using. The style set was created from scratch not based on an existing style set or using any themes. The only thing I really changed was to set the Active row Back Color to be transparent.
Thank you for all your help. I really appreciate it.
It's really hard to say - there are so many ways that these kinds of properties can be set. Perhaps it's not the row, but rather the cells that are showing up. Or perhaps some other UIRole in your Application Style Library is interfering.
If the red cell is turning white when the row is clicked, then it could be the selected appearance for the row or cell, or the active appearance for the row or cell.
If none of that helps, then I'm out of ideas. If you can duplicate this in a small sample project and post it here, I will take a look.