Hello All,
I'm having trouble setting the backcolor of a row.
If I do this:
ultraSectors.Rows[i].Appearance.BackColor = Color.Red;
I need to click on the grid to effect the change. Is there a way to do this automatically without having to set focus to the grid ?
Thanks in advance
midfieldgeneral said:I need to click on the grid in order to effect the color change if the error row had focus prior to the button click.
When you change the Appearance on a row, the grid is supposed to respond to this by repainting the row. The fact that the appearance is not changing until you click on the grid says to me that the grid is not properly responding to the notification when the Appearance is being changed. Clicking on the grid has the effect of invalidating everything, so it's essentially the same as notifying the grid that an appearance has changed.
My guess is that you are using a pretty old version of the grid and that this is a known bug which was fixed a long time ago. What version of the grid are you using?
If I am wrong, and you are not using an old version of the controls, then this most likely a bug, but it seems very unlikely that something this big would go unnoticed for so long.
It sounds like the ActiveRow appearance is overriding the appearance of the row itself. You might want to look at:
FAQ:How do I turn off the ActiveRowAppearance so that the active row in the UltraWinGrid does not appear selected
I guess you could also handle the AfterRowActivate and keep updating the ActiveRowAppearance if the row is an "error row".
-Matt
I have a button control, outwith the grid. When clicked, it processes row changes (updates and inserts). If a cell value is deemed to be invalid, I wanted to highlight the row in red for the benefit of the user. This works fine for the most part, but after clicking the button, I need to click on the grid in order to effect the color change if the error row had focus prior to the button click. If the error row was not the current row, the process works fine.
Is there a way to force the color change without having to set focus to another row in the grid ?
Thanks in advance!
Where are you setting this code? The grid should be updating the row itself automatically without you forcing the row's element to be invalidated by mousing over it.
Hello,
You can either set it from the designer or the Form's Loaded event and it will work like a charm.
Sincerely,
Petar Monov
Developer Support Engineer,
Infragistics, Inc