Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
490
How to avoid color change of the group by row when selected?
posted

I set the back color appearance for a group by row as it is outlined here: http://help.infragistics.com/Help/Doc/WinForms/2011.2/CLR2.0/html/WinGrid_Styling_Rows_and_Row_Connectors_in_Outlook_Group_By_Mode.html

this.ultraGrid1.DisplayLayout.Bands[0].Override.GroupByRowAppearance.BackColor = Color.White;

However, when I click on the group by row, the color changes to the original color. I don't want this change to happen, because another group by row has the same original color.

How can I avoid the color change of the group by row appearance back color when selected?


  • 469350
    Verified Answer
    Offline posted

    Hi,

    Normally, when you select a row in the grid, whether it's a data row or a GroupByRow, the row uses the system highlight color for selection.

    If your selected rows are taking on the normal row appearance, then my guess is that you are probably setting the SelectedRowAppearance somewhere to use the same BackColor and ForeColor of un-selected rows. But that's not a good solution, because it's going to cause problems like the one you have here.

    To make things more complicated, even though you are using the term "selected" here, the row might also be Active and so you should check the ActiveRowAppearance, too.

    So I'd see if/where you are setting either of those and then stop doing that.

    Then, turn off the selection of GroupbyRows by setting grid.DisplayLayout.Override.SelectTypeGroupbyRow to None.

    Of course, if you are using a style library, the style library will override the colors, also. So you might have to modify the style library, too. Or you there may be a way to work around it without modifying the style library, but that would depend on where the appearance is actually coming from.