Hi,
I'm using an ultragrid that is usingAppStyling. Certain columns of my grid are set to a colored background - column.CellAppearance.BackColor=Color.Yellow;
When I edit the cell - I lose the background color until I click out of the cell. When I turn off appstyling, the color remains when cell is edited but I lose all the other styling that I need. Is there a way I can override just this one style?
Hello Pearly,
Thank you for posting in our forum.
Here is how you can change the cell appearance when it is in edit mode:
With AppStylist open go to Grid canvas;
Hoover with the mouse over the grid’s cell and when Role Selection tooltip is shown press “1”. This should open the GridCell element properties (you can also go to Style Explorer -> Roles -> UI Roles -> Base -> Cell -> GridCell);
Select Other States tab in Properties window;
Select Edit mode and apply the appearance you need.
Please let me know if you have any further questions.
Thank you for using Infragistics Controls.
Sorry for not making this clear - I do not want to change the app styling. I have many grids using it that all need the properties that are set currently the way they are. I want to override or disable one property for one grid.
Thanks,
pearly
Thank you for your feedback.
If I understand you correctly you have several grids in your application all of them using same AppStylist .ISL file. What you need is to have custom appearance in one of the grid’s cell when it is in edit mode. One possible solution to achieve this is to set EditCellAppearance of this particular grid in your application. In order to apply this appearance you will need to set ResolutionOrder property in your style library to ControlThenApplication. To do so in Style Explorer select under Component And Role Settings the component you need to set the ResolutionOrder (you can choose All Components or UltraGrid depending on your application scenario). Then in Common Component Properties find and set the ResolutionOrder property. Please check the attached sample project where I have implemented this approach.
Other possible solution is to add custom StyleSet in your style library and to use it for this particular grid. Please follow the next link to find how to create a new StyleSet in your library http://help.infragistics.com/Doc/WinForms/current/CLR4.0/?page=Styling_Guide_Creating_a_StyleSet.html and this one in order to find how to apply it to a specific control http://help.infragistics.com/Help/Doc/WinForms/2015.2/CLR4.0/html/Infragistics4.Win.v15.2~Infragistics.Win.UltraStylableComponent~StyleSetName.html.
Please let me know if you need any additional information.
hi - none of these solutions work for me. I do not want to modify my styles file - I have a bunch of grids using this stylist file, if I change resolutionOrder I need to test each grid to make sure this didn't mess up anything (a grid could've had something set and not removed bec it wasn't affecting the grid). Creating a new style for my grid is not too helpful either - I may as well turn appstyling off.
I remain with my original question - is it possible to override editcellappearance for a grid using appstyling or to disable that style for this one property only?
for ex - to override some other properties - setting ActiveAppearancesEnabled to false or ThemedElementAlpha = Alpha.Transparent
No, there is no simple way to override the style of the cell applied via style library with one set in runtime. One possible solution, will be to use DrawFilter and to override there the cell’s appearance. Please note, this will be much more complex than the solutions I have given you in my previous post.