My Grid is NOT read only, so I can't set the CellClickAction to SelectRow. I set both the ActiveRow and SelectedRow's backgroup to Red, but only the clicked cell shows as Red. How do i set the whole row as Red background?
Thanks!
Amy
You can set the active row's background appearance by doing the following.
private void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e) { ultraGrid1.DisplayLayout.Override.ActiveRowAppearance.BackColor = Color.Salmon; }
Also, if you're using an ISL style file to make a sexier looking grid then you could edit that style file's common states for the grid in AppStylist so the active row highlights what ever color or background image you'd like.
The Solution is NOT working, it just change the cell background color, not the whole Row., since my grid is not read only and CellClickAction is NOT SelectRow.
Any othere suggestion?
Thanks in advance!
Hi,
yamao said:The Solution is NOT working, it just change the cell background color, not the whole Row., since my grid is not read only and CellClickAction is NOT SelectRow.
What's the difference? What part of the row do you want to apply a color to that is not the background of a cell?
If nothing you do to the ActiveRowAppearance is working then there are two possibilities:
1) Something in your code is overwriting your settings. Since you have a screen shot of the property grid here, I assume you are setting these properties at design-time. I recommend that, as a test, you put a button on the form and in the Button click event you display one of the properties that you are setting here to see if it's still set to the same value.
My guess is that it will not be. That means it's getting lost of overwritten. This could be because you are explicitly setting or resetting the appearance in code, or it could be because you are loading a Layout or a Preset.
Or the entire design-time layout might be getting blown away when you bind the grid at run-time if you are binding to a DataSource that doesn't match up to the one you are establishing at design-time.
2) If the button click shows that the property is still set, then the only possible reason I can think of for that is that you are loading an Application Style Library (.isl) file into your app which is overriding the grid properties.
Yes, I am sure I have ActiveRowApperance set, not activeCell and ActiveRowCell. it seems none of the ActiveRowApperance setting is honered. The light blue clor is from DefaultSelectedBackColor. Here is my settings:
The active row's background color and font are not working at all. Any suggestion?
ActiveRowAppearnce applies to the entire active row. If your appearance is only applied to a single cell, then something is wrong. Are you sure you used ActiveRowAppearance and not ActiveCellAppearance?
Here is just cell hightlighted:
I would like to have the whole is highlighted as follow(using a regular datagrid):