title: How to enable DevExpress Grid Conditional Formatting?
body: <p>I have a .net, C# Windows Form project.  I'm using DevExpress 19.1.  On my GridControl, I have conditional formatting for when a column is less than 0.  I want the cell to be highlighted red when the value is less than 0, but it's not working.  I've tried using an expression, a condition and value, applying to just a column, applying to the whole role, but I never get the highlighting to work.  Can someone tell me what I'm doing wrong?</p>
  <p>Here is how the rule looks liked in code:</p>
  <pre><code>        gridFormatRule3.ApplyToRow = true;
          gridFormatRule3.Column = this.colQuantityLeft;
          gridFormatRule3.ColumnApplyTo = this.colQuantityLeft;
          gridFormatRule3.Name = &quot;Format0&quot;;
          formatConditionRuleValue3.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
          formatConditionRuleValue3.Appearance.Options.UseBackColor = true;
          formatConditionRuleValue3.Condition = DevExpress.XtraEditors.FormatCondition.Less;
          formatConditionRuleValue3.Expression = &quot;[QuantityLeft] &lt; 0&quot;;
          formatConditionRuleValue3.Value1 = 0;
          gridFormatRule3.Rule = formatConditionRuleValue3;
          this.gvProducts.FormatRules.Add(gridFormatRule3);
  </code></pre>
  <p>Here's how I set the rules in the Designer:</p>
  <p><a href="https://i.stack.imgur.com/j8nli.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/j8nli.png" alt="enter image description here" /></a></p>
  <p>Here's the output where you can see the value is less than 0 and the background color is not changed:</p>
  <p><a href="https://i.stack.imgur.com/ra9Yc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ra9Yc.png" alt="enter image description here" /></a></p>