Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
145
GridRow Selected Background color issue
posted

I am using an existing ISL and added a styleset to customize the look of the WinGrid. UltraGrid is specified as the selected control. I set the "based on" to use the default styleset because it has attributes that I want to use (i.e. header background color).

The default styleset specifies a resource as the selected background; I want to override this with a solid color. 1. The selected substyle does not show the resource from the "based on" style as I would expect 2. My specified solid color does not override the "based on" style.

As a test, I switched the "based on" to "none": my solid color background now appears as expected (of course none of the required attributes of the default styleset are included).

Am I doing something incorrectly? I don't want to to have to recreate the default GridRow style. Screenshot of appstylist is shown below, notice the selected row background color - that is coming from the default styleset.

 

  • 469350
    Suggested Answer
    Offline posted

    Hi,

    My guess is that your base StyleSet is applying a background image. If that's the case, then you will not be able to override the image with a color, because the appearances are merged.

    So basically, if you have a background image in the base StyleSet and you set the color in the derived StyleSet, the derived items will use both the color and the image. Since the background image covers teh background color, you will not see the color.

    Unfortunately, there's no way to override the image and set it to null.

    So the only way to achieve what you want here would be to either use a new background image in the derived StyleSet (you could create an image with a solid color). Or you would have to remove the image from base StyleSet and derive a new StyleSet with the image and apply that StyleSet to all of the other grids in the application excluding the one where you want to use a solid color.