Hello, I'm new with ultragrid, i appreciate your answer
i want to change background color when mouse over the row
also i dont know how to put only row select not alow cel select .....i want a solid background color to all of the row
and how to put the grid with alternate backgrpound color
thanks a lot
Hi Steve,
There must be something else in the isl affecting it, then. Can you post the isl file here? You may need to zip it up because the forum might not accept a file with an .isl" extension.
Mike,
Do as you suggested won't work.
The only way to make is work is remove the block and then write this code in AfterInitializeLayout:
e.Layout.Override.HotTrackRowAppearance.BackColor = Color.Yellow; e.Layout.Override.HotTrackRowAppearance.ForeColor = Color.Black; e.Layout.Override.HotTrackCellAppearance.BackColor = Color.Yellow; e.Layout.Override.HotTrackCellAppearance.ForeColor = Color.Black; e.Layout.Override.HotTrackCellAppearance.FontData.Bold = DefaultableBoolean.True;
-Steve
Well, there is something of a learning curve here.
It looks like your isl is pointing this role to a resource. So removing this block will turn off the white background color and that's fine if that's what you want.
If you want to keep the white background and change the foreground color, you have to modify the resource - not the UIRole. So if you open up the isl, go to the Resources tab and find the resource with the same name (GridRow_HotTracked) and set the ForeColor. A Resource is like an Appearance that you can apply multiple propreties to the same role.
This ISL file is so cumbersome. I used your brutal force suggestion and identified this block as the culprit:
<state name="HotTracked" backColor="Transparent" backGradientStyle="None" backHatchStyle="None">
<resources>
<name>GridRow_HotTracked</name>
</resources>
</state>
The troubling thing is, changing the backcolor and adding forecolor didn't help. I had to delete this block to make the problem go away. WOW. I would strongly recommend simplify the ISL file definition. There are numerous HotTracked tag related to the row and cell across the file. The entire file is 970 lines long! Should be less than 100.
My best guess is that the Isl file is setting a background color for the HotTracked rows, but not a ForeColor. Setting a BackColor without also setting a ForeColor is generally a bad idea for the very reason that you can't rely on the colors to be sufficiently different to make sure the text is visible.
It's sometimes tough to track down where a certain color is applied in an isl, since there are so many UIRoles that affect the same object(s).
So there are a couple of approaches you can take. One way to track this down is to open the isl file up in an xml editor. Isl files are just xml documents. So you could search the text for "HotTracked" and see if you can find a place where the backcolor of the row is being set to white.
Another option it to open up the isl in AppStylist and then find a likely suspect UIRole and reset it (by right-clicking and choosing reset from the context menu) and keep doing that until the white backcolor goes away. By process of elimination you can find the role that's doing it.