Syncfusion.PivotAnalysis.Windows
Example 


NewRuleConditionalFormat Property

Gets or sets the collection of PivotGridNewRuleConditionalFormat.
Syntax
'Declaration
 
<CategoryAttribute("Pivot")>
<BrowsableAttribute(False)>
<DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)>
<XmlIgnoreAttribute()>
Public Property NewRuleConditionalFormat As ObservableCollection(Of PivotGridNewRuleConditionalFormat)
'Usage
 
Dim instance As PivotGridControlBase
Dim value As ObservableCollection(Of PivotGridNewRuleConditionalFormat)
 
instance.NewRuleConditionalFormat = value
 
value = instance.NewRuleConditionalFormat
[Category("Pivot")]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[XmlIgnore()]
public ObservableCollection<PivotGridNewRuleConditionalFormat> NewRuleConditionalFormat {get; set;}
Example
This example shows how to use the NewRuleConditionalFormat property.
void TableControl_CellClick(object sender, Syncfusion.Windows.Forms.Grid.GridCellClickEventArgs e)
{
   // Initializing a new rule.
   NewRuleConditionalFormat newRule1 = new NewRuleConditionalFormat();
   // Setting the condition types and predicate types.
   ConditionalFormat form = new ConditionalFormat();
   form.ConditionType = PivotGridDataConditionType.Equals;
   form.PredicateType = PredicateType.Or;
   form.StartValue = 5;
   form.EndValue = 555;
   newRule1.Conditions.Add(form);
   // Formatting is done if the condition gets satisfied.
   PivotGridNewRuleConditionalFormat newRuleFormat1 = new PivotGridNewRuleConditionalFormat();
   newRuleFormat1.NewRuleCollections.Add(newRule1);
   // Sample condition.
   if (form.StartValue < e.RowIndex)
   {
       this.pivotGridControl1.TableModel[e.RowIndex, e.ColIndex].TextColor = Color.Red;
   }
   // The new rule gets associated with the pivot grid.
   this.pivotGridControl1.TableControl.NewRuleConditionalFormat.Add(newRuleFormat1);
}
Private Sub TableControl_CellClick(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridCellClickEventArgs)
   ' Initializing a new rule.
   Dim newRule1 As New NewRuleConditionalFormat()
   ' Setting the condition types and predicate types.
   Dim form As New ConditionalFormat()
   form.ConditionType = PivotGridDataConditionType.Equals
   form.PredicateType = PredicateType.Or
   form.StartValue = 5
   form.EndValue = 555
   newRule1.Conditions.Add(form)
   ' Formatting is done if the condition gets satisfied.
   Dim newRuleFormat1 As New PivotGridNewRuleConditionalFormat()
   newRuleFormat1.NewRuleCollections.Add(newRule1)
   ' Sample condition.
   If form.StartValue<e.RowIndex Then
      Me.pivotGridControl1.TableModel(e.RowIndex, e.ColIndex).TextColor = Color.Red
   End If
   ' The new rule gets associated with the pivot grid.
   Me.pivotGridControl1.TableControl.NewRuleConditionalFormat.Add(newRuleFormat1)
   End Sub
AssemblyVersion

Syncfusion.PivotAnalysis.Windows: 18.2460.0.44

See Also