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
1105
Group By Row Active Color
posted

Hey Gang,

Another oddball request for help here.  I've been tasked with making the grid appear "flat".  In other words, allowing the user to set the grid into a mode where the colorings and behaviors appear to be that of a typical form.

I stumbled into the already existing FlatMode property which is a huge help.  But now I'm trying to clean up a few places.

One such place is when the grid is in GroupBy mode (ie a user has dragged a column header into the GroupBy Box).

When this occurs, clicking on any of the groupby rows causes them to assume the usual system highlight color.

I was able to prevent this from occurring on normal row click by setting the activerow appearance object's backcolor to the same color as the normal row back color (so it's actually active, but because it uses the same color it doesn't appear highlighted).

However, I'm not finding a property that would allow me to do this for group by rows.  Essentially while in this "mode" clicking on any row, be it a group by row or normal row, should not change the color.

Any suggestions?

Thanks,

Chris Rowland

  • 469350
    Suggested Answer
    Offline posted

    Hi Chris,

    Chris said:
    I was able to prevent this from occurring on normal row click by setting the activerow appearance object's backcolor to the same color as the normal row back color (so it's actually active, but because it uses the same color it doesn't appear highlighted).

    You can just reset the ActiveRowAppearance, rather than trying to set it to the same color. The color is  a system color, by default. So setting it to the same color won't work on every machine.

    Chris said:
    However, I'm not finding a property that would allow me to do this for group by rows.  Essentially while in this "mode" clicking on any row, be it a group by row or normal row, should not change the color.

    Brian is probably right that the row is getting selected as opposed to Active. But the SelectedRowAppearance won't help you there, since the default selected appearance is resolved by the control to the system highlight color, it's not applied to the appearance properties.

    What you would have to do in a case like this is either turn off selection (using the SelectTypeGroupByRow property on the Override) or by setting DefaultSelectedBackColor and DefaultSelectedForeColor on the DisplayLayout to Color.Empty. 

     

  • 69832
    Suggested Answer
    Offline posted

    I think the appearance you want is the UltraGrid.DisplayLayout.Override.SelectedRowAppearance.