I have a grid that has a lot of bands and am wondering if there is a way to apply ValueBased conditions across the bands and columns. For example, if the % > 10% then set the forecolor to red.
Hello,
Thank you for posting in our forums.
What you could do in order to achieve this is to use the InitializeRow event. It will fire each time a row has changed. In it you can check the value that you are interested in and apply the desired appearance to a cell in another column or band.
I have attached a sample demonstrating this suggestion.
Please let me know if you have any additional questions.
I understand what you are doing but it's not a practical application for my situation. We build lots of grids and I need it to be more generic. Is it possible to access the ValueBasedAppearance settings created during design time. My thought is that I could enter the property values once but then apply the settings to the bands and columns that I want in the code.
Hi,
Thank you for the reply.
There is no designer support for reusing the ValueBasedAppearances. What I would suggest in your case is to create a public static collection with the ValueBasedAppearances in code and apply the ValueBasedAppearances to the columns in your grids where you need them.
I am just checking about the progress of this issue. Let me know if you need my further assistance on this issue.
Thank you for using Infragistics Components.
You need to provide an IFormulaProvider object (which generally is the column) and a formula. You can find more information from this link:
http://help.infragistics.com/Help/Doc/WinForms/2011.2/CLR2.0/html/Win_Create_a_Formula_Condition.html
I also modified my sample to use such formula.
Do you have any examples where the ValueBasedAppearance is set by using a formula as opposed to just an operator in the code?
Thanks for your help.