Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The The Consultingwerk.Windows.Util.ValueBasedAppearanceFactory simplifies uses the use of the ValueBasedFormatting feature of infragisticsInfragistics. The following Consultingwerk classes support the ValueBaseAppearanceFactory:

ValueBasedAppearanceFactory supports the developer when using value-based formatting. 
You can set the forecolor, backcolorback color, fontstyle font style etc. for a row or cell based on the cell value. 
This is very helpful , e.g. if you want to highlight a status of an order or if you have time-based deadlines on your grid.

The following document describes how to use the ValueBasedAppearanceFactory the ValueBasedAppearanceFactory to simplify the usage of the Infragistics.Win.UltraWinCalcManager.UltraCalcManager and the ValueBasedFormatting capabilities of the UltraGrid on your screens. Furthermore, it illustrates the importance and possibility of the properties.

The example demonstrates the functionality of the ValueBasedAppearanceFactory the ValueBasedAppearanceFactory on the base of the “Order” Table in the Sports2000 database using the SmartComponent Library.

The screen shows different distinct colors for the different order status values. When the order status is set to “Approval Pending” , and the row appears red. When the row is shown in green and , the font type is italic, and the order status is “Ordered”.  If the order status is set to “Shipped” , the font type is set to bold.  

The following properties should be used in the ValueBasedAppearanceFactory:

...

In our example we set three different appearances based on formulas validating the values “Ordered”, “Pending” and “Shipped” in the column “Orderstatus”. 

Code Block
linenumberstrue
DEFINE VARIABLE oOrderedAppearance AS Infragistics.Win.Appearance NO-UNDO .
 
oOrderedAppearance = oFactory:AddAppearanceForCondition ("[OrderStatus] = ~"Ordered~"":U) .
oOrderedAppearance:BackColor = System.Drawing.Color:LightGreen .
oOrderedAppearance:FontData:Italic = Infragistics.Win.DefaultableBoolean:True .
 
oFactory:AddAppearanceForCondition ("[OrderStatus] = ~"Approval Pending~"":U):BackColor = System.Drawing.Color:LightCoral .
oFactory:AddAppearanceForCondition ("[OrderStatus] = ~"Shipped~"":U):FontData:Bold = Infragistics.Win.DefaultableBoolean:True .

...