I am attempting to override the appStylist theme setting for the Active UltraGridRow. Even if I False UseOSThemes, and False UseAppStyling I can not override the Active UltraGridRow Appearance. The purpouse is to provide a visual to the user that will indicate when an object is selected or not. This functionality works fine once the AfterSelectChange event is fired, i.e. activate a new row. I need to change the appearance of the active row itself. For instance if I click once on a row it should activate with the themed appearance. If I click on that row once more it should change the apperance of the active row.
Here's a simple example of one way I have tried.
Row.Appearance.BackGradientStyle = GradientStyle.GlassBottom37Bright;
Row.Appearance.BackColorAlpha = Alpha.Opaque;
Row.Appearance.ForeColor = Color.Black;
Figured out a pretty easy way of doing this, just had to find the appropriate namespace I guess. Any way here is a brief example of toggeling the active row appearance based on cell value.
First set the grid property UseOsThemes to False.
Second set the UseAppStyling Property to False.
Third Create the property below.
/// Sets the active row and selected row appearances based on the field "Boolean" value
{
set
Grid.ActiveRow.Band.Override.ActiveRowAppearance.BackColor = Color.White;
Grid.ActiveRow.Band.Override.ActiveRowAppearance.ForeColor = Color.Black;
Grid.ActiveRow.Appearance.BackColor2 = Color.WhiteSmoke;
}
Grid.ActiveRow.Band.Override.ActiveRowAppearance.BackColor = Color.Orange;
Grid.ActiveRow.Band.Override.ActiveRowAppearance.ForeColor = Color.WhiteSmoke;
Grid.ActiveRow.Appearance.BackColor = Color.Orange;
Grid.ActiveRow.Appearance.ForeColor = Color.WhiteSmoke;
Fourth: Not sure if you'll need this functionality, but I call this method via the mouse down event. Here is how I am accomplishing it, who knows it may or may not help you.
Point pt = new Point(e.X, e.Y);
//Single select only clear all other rows.
//set the appearance of the row
Im sure there is a much much easier way of achieving this, I attempted to use the grid formulas and value based cell appearance to accomplish this but I am still learning the ins and outs of the infragistics controls. If your grid supports multiple selection and you want to simulate the ctrl + click functionality with out the end user actually having to hold down the control key, just remove the for statment in the mouse down event.
Hope this helps someone :)
I need to override some of the appstylist settings for the active row of a grid. I have set the ResolutionOrder as ControlThenApplication but the ISL file happens to have some UI role settings for the Grid Row. How can I override these settings in my code?
I have set the ActiveRowAppearance on the Override of DisplayLayout for the Grid and also the above mentioned steps but it doesnt make any difference once I load such an ISL file.
I will not be able to change the GridRow settings in the ISL file because it seems to be used by UltraCombo also and I want these changes to be done only in the UltraGrid.