Hi,
I have a grid with different unbound columns, where I set background images for demonstrating a process step for the particular row.
No I want to highlight the active row. So when I set the Override.ActiveAppearance to "enabled" my row has its highlight from the stylefile.This works fine, but my problem is, that the format of my images in the cells gets distroyed. See in the below Screenshot:
Any ideas how to prevent this behavior?
Thanks in advance
Alex
Hi Alex,
Are you applying the ActiveRowAppearance via a style library file? Or in code? Or both?
What kind of settings are you applying to the active appearance? I can't see why BackColor or ForeColor should have any effect on the image, but there are other settings, like the ImageBackgroundStretchMargins or the image origin that might affect the images.
Can you post a small sample project demonstrating this behavior? If I can see this behavior occurring, I should be able to track down the cause.
Hello Mike,
I am using Claymation style from the style library file which is provided by Infragistics, but I didn't modify it.
In Code I do not manage appearances.
Settings on my override.ActiveCellAppearance are:
ImageBackgroundStyle = Stretched , TextHAlign = Center.
But It seems that this is a problem of the style File. In my sample project I use 2 different Style files, and with claymation its not working. If this is the solution, can you tell me what I have to change in the stylefile then?
You should probably remove the setting of the ImageBackgroundStyle and the TextHAlign. Those are probably what is messing up the images.
If those are in the isl file, then I assume they are in there because the isl file already had an background image applied to the cells. But since you are overriding that anyway, you don't need the extra property settings.
Mike,
removing these properties does not have any effect. Also for the sample project I posted yesterday its not working when I turn of these settings.
But I found out, that every change in my grid is overwritten by the style file. Because when I set the backgroundcolor of the active cell and row to e.g. red, it remains in this grey from the style file.
This is strange, I dont know why changes in my grid do not have an effect.
I am still thinking that this behavior occurs because of the background color. Maybe the background color needs space to be shown and so the images get smaller. Maybe the background color should be transparent. But I cannot try this because my settings are overwritten.
So I first need a way now to make my settings in the grid working.
linksaussen said:But I found out, that every change in my grid is overwritten by the style file. Because when I set the backgroundcolor of the active cell and row to e.g. red, it remains in this grey from the style file.
There's nothing strange about that at all. The Application Style Library is supposed to override any settings in the application. It would not be very useful for any existing application, otherwise.
Anyway, I'm sorry I did not notice that you attached a sample yesterday. I took a look at your sample today and I am getting the same behavior you are.What I typically do in cases like this where I know the Style Library is causing an effect I don't want, is to use the AppStylistRuntime component to style the app at run-time. This was I can see what roles affect the object in question and I can reset those roles one at a time to see which one is causing the problem.
In this case, the behavior is caused by the GridRow UIRole, and in particular, it's Active state.
This role has a Resource applied to it: "gridRowClaymation_Active". So I looked at the xml in the isl file and I can see that this resource has set it's ImageBackgroungStretchMargins. It's specifically altering the background image.
<resource name="gridRowClaymation_Active" backColor="White" imageBackgroundStyle="Stretched" fontBold="True" backColor2="DarkGray" backGradientStyle="Vertical" imageBackgroundStretchMargins="0, 16, 0, 3" />
You cannot see this from within AppStylist, since there is no background image actually applied to the resource.So what you can do is:
Or... if you prefer, you could modify the isl file directly in Notepad and remove the:
imageBackgroundStretchMargins="0, 16, 0, 3"
That's it!
Thanks.
I tried this out with your original sample and it doesn't seem to have anything to do with the AppStyling. If I comment out the call to StyleManger.Load, it still happens (although the button looks slightly different since Themes are on).
I think the problem is that you have assigned the image to the cell's Appearance and not the ButtonAppearance. In fact, your code assigns both a CellAppearance and a CellButtonAppearance to the column, but only the CellAppearance includes the image background.
Hi Mike,
Now I have another problem concerning this matter. I told you that the problem with the images getting destroyed is solved now. But now I have a similar problem with the grid cell button.
I am using an ultragrid where I put some background images to several cells. I also use the claymation style file from the style library.
I have the problem, that when I hover with my mouse over the cell button, my background images disappear. In designer there is no property to set this, so I tried to figure out which role or property this might be in the style file. But in the app stylist I cannot find some hot track properties for the Grid cell button.
In my attached images you can see that when I hover over the cell button the green image disappears.
The second image shows where I searched for the properties of grid cell button in app stylist.
Do you have any other idea to disable this hot track appearance?
That's it! Now it works as expected.
Thanks a lot!