When my grids get rendered,the first row is getting highlighted with a special color. The color itself is coming from some .isl created by another group.
Reading previous posts it seems the key is ActiveRowAppearance property.
I want that first row color to be like any other row i.e. it should not look any special.
Thanks!
The reason the line of code you have posted here under #2 does not work is because the isl file overrides any settings in the grid by default. It has to. Otherwise, the isl would not be very useful for making all applications look the same.
If you want the application settings to override those in the isl, you would have to modify the isl. You would go to the grid's component role and set the ResolutionOrder property. This would allow the control settings to override the isl settings. But it's all or nothing.
Another option would be to modify the isl so that it does not apply an appearance to the grid's Active row. This would affect all grid's, however.
Yet another option would be to use a StyleSet. An isl can contain multiple StyleSets and you can set the StyleSetName property on any Infragistics control to tell it to use a specific StyleSet. So what you could do is have 2 StyleSets in your isl: one with an active row appearance and one without. Then you could use one StyleSet for the "main" grid and a different one for the other grids in the application.
If you cannot modify the isl, then you have two other options. One would be to modify the style library information in memory. This is rather complicated and once again has the disadvantage that you can't affect some controls without affecting others.
The last optoin would be to use a DrawFilter and explicitly modify the colors while the grid is painting. If you want to try this and you are not familiar with DrawFilter, I recommend checking out the Infragistics Knowledge Base. There are lots of articles with sample DrawFilters. Also, get the Infragistics UIElementViewer Utility. It's a huge help with dealing with UIElements.
Mike,
When I uncomment the StyleManager.Load, indeed the highlighting-with-special-color problem goes away. Unfortunately, as I said, I am required to use the "isl" file to standardize the look of all apps. it.
Let me explain the problem a little more. I have three (or even four) grids stacked on top of each other. The one in the middle has the primary data that is editable while the other two (or three) holds supporting read-only data.
You can imagine having 4 grids stacked on each other with four rows highlighted. It potentially distracts attention of the user from the primary grid. Ideally I would like to use isl color schema for the primary grid but have something different for the other two (or three) supporting grids. That way, the user's attention is drawn to the editable data in the primary grid. Please see screenshot in the attached link
http://www.imagebam.com/image/eba13c10538333
1. I am looking for ideas to get around this supporting-grids-having-hightlighted-row-causing-distraction problem
grid.DisplayLayout.Override.ActiveRowAppearance.FontData.Bold = DefaultableBoolean.True;
3. What parts of Appearance can the code override over isl's settings?
Um.. just to test that theory, why don't you comment out the line of code that calls StyleManager.Load and see if the active row appearance is still there?
There is a default ActiveRowAppearance and ActiveCellAppearance applied ot the grid - but these are applied by loading a default prese, which can only be done in the designer. So if you are creating the grid programmatically and not by placing it on the form designer, then that can't be the issue. So your ActiveRow must be coming from the Application Style. Which means there's no way around it except to remove it from the Isl.
I don't think you can get rid of the active row concept, and you shouldn't :)
There's indeed a different default appearance for the active row though, so maybe you should set the activerow appearance to the normal appearance:
AppearanceData data = new AppearanceData();
_grid.Rows[x].ResolveAppearance(ref data); // Row x being a row that is NOT the active row
_grid.Displayout.Override.ActiveRowAppearance = new Appearance(data);