Ejemplo n.º 1
0
        private void BindCondtion(GridColumn column, int min, int max)
        {
            GridFormatRule           gridFormatRuleMax           = new DevExpress.XtraGrid.GridFormatRule();
            FormatConditionRuleValue formatConditionRuleValueMax = new DevExpress.XtraEditors.FormatConditionRuleValue();

            formatConditionRuleValueMax.Appearance.ForeColor            = System.Drawing.Color.Red;
            formatConditionRuleValueMax.Appearance.Options.UseForeColor = true;
            formatConditionRuleValueMax.Condition = DevExpress.XtraEditors.FormatCondition.Greater;
            formatConditionRuleValueMax.Value1    = max;
            gridFormatRuleMax.Rule   = formatConditionRuleValueMax;
            gridFormatRuleMax.Column = column;

            GridFormatRule           gridFormatRuleMin           = new DevExpress.XtraGrid.GridFormatRule();
            FormatConditionRuleValue formatConditionRuleValueMin = new DevExpress.XtraEditors.FormatConditionRuleValue();

            formatConditionRuleValueMin.Appearance.ForeColor            = System.Drawing.Color.Red;
            formatConditionRuleValueMin.Appearance.Options.UseForeColor = true;
            formatConditionRuleValueMin.Condition = DevExpress.XtraEditors.FormatCondition.Less;
            formatConditionRuleValueMin.Value1    = min;
            gridFormatRuleMin.Rule   = formatConditionRuleValueMin;
            gridFormatRuleMin.Column = column;
            this.gridView1.FormatRules.Add(gridFormatRuleMax);
            this.gridView1.FormatRules.Add(gridFormatRuleMin);
        }