Hi
I have a grid that the user is entering information into.
If one of the values is set a certain way we highlight a cell that needs attention by changing its background colour.
If however the row is selected/highlighted all custom background formatting is not visible so the user is unable to see that a cell has been highlighted.
How do I either turn off the highlighting of a row or override the highlighting with my background at run time
None of the below appear to work in the initialize row event:
e.Row.Cells["Weight"].Appearance.BackColor = Color.Tomato;
e.Row.Cells["Weight"].Appearance.BorderColor = Color.Khaki ;
e.Row.Cells["Weight"].SelectedAppearance.BackColor = Color.Purple;
e.Row.Cells["Weight"].SelectedAppearance.BorderColor2 = Color.RoyalBlue;
e.Row.Cells["Weight"].ActiveAppearance.BackColor = Color.Green;
e.Row.Cells["Weight"].ActiveAppearance.BorderColor2 = Color.RoyalBlue;
e.Row.Appearance.BackColor = Color.Orange;
e.Row.Band.Override.SelectedCellAppearance.BackColor = Color.Lime;
e.Row.Band.Override.SelectedRowAppearance.BackColor = Color.Lavender;
e.Row.Band.Override.ActiveCellAppearance.BackColor = Color.Lime;
e.Row.Band.Override.ActiveRowAppearance.BackColor = Color.Lavender;
e.Row.Band.Override.ActiveRowAppearance.BackColor = Color.Coral;
e.Row.Band.Override.ActiveRowCellAppearance.BackColor = Color.Lime;
e.Row.Band.Override.ActiveRowCellAppearance.BackColor2 = Color.Lime;
e.Row.Band.Override.ActiveCellAppearance.BackColor2 = Color.Lavender;
Another option is... when you set the Appearance on the Cell, you could also set the SelectedAppearance and/or ActiveAppearance on that same cell to the same appearance. that way the cell would appear the same regardless of whether it was selected or active.
This worked a treat thank you very much
Hello,
I have found a more efficient and direct solution to turn off highlighting. Please set the following two AppearancesEnabled properties to false in your application and please ignore my previous post.
this.ultraGrid1.DisplayLayout.Override.ActiveAppearancesEnabled = DefaultableBoolean.False; this.ultraGrid1.DisplayLayout.Override.SelectedAppearancesEnabled = DefaultableBoolean.False;
this.ultraGrid1.DisplayLayout.Override.ActiveAppearancesEnabled = DefaultableBoolean.False;
this.ultraGrid1.DisplayLayout.Override.SelectedAppearancesEnabled = DefaultableBoolean.False;
Hello barney_nicholls,
As you can already tell, it's not relatively straightforward to remove row highlighting. The simplest way to do so would be to first handle the BeforeRowActivate event and place the following line two lines of code:
this.ultraGrid1.DisplayLayout.Override.ActiveRowAppearance.Reset(); ///Optional. Can keep the background color visible when the cell is in edit mode //this.ultraGrid1.DisplayLayout.Override.ActiveCellAppearance.Reset();
this.ultraGrid1.DisplayLayout.Override.ActiveRowAppearance.Reset();
///Optional. Can keep the background color visible when the cell is in edit mode //this.ultraGrid1.DisplayLayout.Override.ActiveCellAppearance.Reset();
Next, by setting the SelectionOverlayColor to SystemColors.Hightlight in the form_load you can prevent the highlight occurring at all.
Please see my attached solution for further demonstrations. Let me know if this helps you.