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;
I have a similar problem. Have a styles *.isl file and I need to change the colors of the editable cells in a grid. But I cannot do it because of a styles that are defined in *.isl file. And I don't want to turn off these styles because it will destroy all application style.
How can I change properties of a grid if it has styles defined in *.isl file?
Thank you!
Hi,
ResolutionOrder is all or nothing. You can't set it for individual properties, it applies to the whole control.
If you want to have different styles for different controls, then your ISL file will need to use multiple StyleSets and then your applicaiton can set the StyleSetName on each control. Or, you can load multiple Style Libraries and use the StyleLibraryName on the control.
You might also be able to get what you want using the StyleLibraryResourceName property on the Appearance object.
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.
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 :)