FormatCondition.Value1 Property

Gets or sets the first constant that is compared with column values. This is a bindable property.

Namespace: DevExpress.Mobile.DataGrid

Assembly: DevExpress.Mobile.Grid.v18.1.dll

Syntax

[XtraSerializableProperty]
public object Value1 { get; set; }

Returns

Type Description
Object

A value that is compared with column values.

Column cells are compared with the Value1 value using the FormatCondition.ValueRule comparison operator. Specific comparison operators require two values. In this case, use Value1 along with FormatCondition.Value2.

The Value1 and FormatCondition.Value2 properties are not supported if the FormatCondition.ValueRule property is set to ConditionRule.None or ConditionRule.Expression.

Examples

This example illustrates how to apply conditional formatting to a Market Share column in a GridControl to highlight cells that match a specific condition. Cells containing values that are less than 20% will be highlighted.

ConditionalFormatting_Condition

  1. Create a new FormatCondition class instance.
  2. Set this object's FormatConditionBase.FieldName property to MarketShare. This column provides values to test against the formatting rule and the specified format will be applied to this column.
  3. Assign one of the predefined formats to the FormatConditionBase.PredefinedFormatName property. All available format names are listed in the Predefined Format Names document.
  4. Specify the comparison operator by setting the FormatCondition.ValueRule property. In this example, the Less operator is used for constructing the rule's criteria.
  5. Set the FormatCondition.Value1 property to 0.20. This means that the format should be applied to cells with market share less than 20%.
  6. To apply a conditional formatting rule represented by the created FormatCondition object, add this object to the GridControl.FormatConditions collection.
using DevExpress.Mobile.DataGrid;
using DevExpress.Mobile.Core.ConditionalFormatting;
// ...

FormatCondition condition = new FormatCondition ();
condition.FieldName = "MarketShare";
condition.PredefinedFormatName = "RedText";
condition.ValueRule = ConditionRule.Less;
condition.Value1 = 0.20;

grid.FormatConditions.Add (condition);