menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class NewRuleConditionalFormat - API Reference

    Show / Hide Table of Contents

    Class NewRuleConditionalFormat

    Represents a class that contains rule for formatting the PivotGridControl.

    Inheritance
    System.Object
    NewRuleConditionalFormat
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.Windows.Forms.PivotAnalysis
    Assembly: Syncfusion.PivotAnalysis.Windows.dll
    Syntax
    public class NewRuleConditionalFormat

    Constructors

    NewRuleConditionalFormat()

    Initializes a new instance of the NewRuleConditionalFormat class.

    Declaration
    public NewRuleConditionalFormat()

    Properties

    Conditions

    Gets or sets the conditions.

    Declaration
    public ObservableCollection<ConditionalFormat> Conditions { get; set; }
    Property Value
    Type Description
    System.Collections.ObjectModel.ObservableCollection<ConditionalFormat>

    The conditions.

    Examples

    This example shows how to use the Conditions property.

    // 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;
    // Adding the created conditional format to conditions.
    newRule1.Conditions.Add(form);
    ' 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
    ' Adding the created conditional format to conditions.
    newRule1.Conditions.Add(form)

    CustomImageList

    Gets or sets the custom image list.

    Declaration
    public ArrayList CustomImageList { get; set; }
    Property Value
    Type Description
    System.Collections.ArrayList

    FormatAllType

    Gets or sets the value of format as all type.

    Declaration
    public FormatAllType FormatAllType { get; set; }
    Property Value
    Type Description
    FormatAllType
    Examples

    This example shows how to use the FormatAllType property.

    void Form1_Load(object sender, EventArgs e)
    {
        // Initializing a new rule.
        NewRuleConditionalFormat newRule1 = new NewRuleConditionalFormat();
        // Sets the rule type. Here "FormatOnlyUniqueOrDuplicateValues" is set.
        newRule1.RuleType = RuleType.FormatOnlyUniqueOrDuplicateValues;
        // Formats the cells that contains unique or duplicate values. By default "Unique" value is assigned for formatting.
        newRule1.FormatAllType = FormatAllType.Duplicate;
        newRule1.SummaryElement = "Quantity";
        PivotGridNewRuleConditionalFormat newRuleFormat1 = new PivotGridNewRuleConditionalFormat();
        ConditionalFormat form = new ConditionalFormat();
        newRuleFormat1.NewRuleCollections.Add(newRule1);
        newRuleFormat1.PivotCellStyle.BackColor = Color.Red;
        this.pivotGridControl1.TableControl.NewRuleConditionalFormat.Add(newRuleFormat1);
    }
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
        ' Initializing a new rule.
        Dim newRule1 As New NewRuleConditionalFormat()
        ' Sets the rule type. Here "FormatOnlyUniqueOrDuplicateValues" is set.
        newRule1.RuleType = RuleType.FormatOnlyUniqueOrDuplicateValues
        ' Formats the cells that contains unique or duplicate values. By default "Unique" value is assigned for formatting.
        newRule1.FormatAllType = FormatAllType.Duplicate
        newRule1.SummaryElement = "Quantity"
        Dim newRuleFormat1 As New PivotGridNewRuleConditionalFormat()
        Dim form As New ConditionalFormat()
        newRuleFormat1.NewRuleCollections.Add(newRule1)
        newRuleFormat1.PivotCellStyle.BackColor = Color.Red
        Me.pivotGridControl1.TableControl.NewRuleConditionalFormat.Add(newRuleFormat1)
    End Sub

    FormateSelectedAverageValueType

    Gets or sets the value of the format as average value type.

    Declaration
    public FormateSelectedAverageValueType FormateSelectedAverageValueType { get; set; }
    Property Value
    Type Description
    FormateSelectedAverageValueType
    Examples

    This example shows how to use the FormateSelectedAverageValueType property.

    void Form1_Load(object sender, EventArgs e)
    {
        // Initializing a new rule.
        NewRuleConditionalFormat newRule1 = new NewRuleConditionalFormat();
        // Formats the pivot cells based on the average values of the cells.
        newRule1.FormateSelectedAverageValueType = FormateSelectedAverageValueType.Below;
        // Make sure to set the rule type as the formating type.
        newRule1.RuleType = RuleType.FormatOnlyValuesThatAreAboveOrBelowAverage;
        // Here "Quantity" is the field-mapping name.
        newRule1.SummaryElement = "Quantity";
        PivotGridNewRuleConditionalFormat newRuleFormat1 = new PivotGridNewRuleConditionalFormat();
        ConditionalFormat form = new ConditionalFormat();
        newRuleFormat1.NewRuleCollections.Add(newRule1);
        // Formating is done.
        newRuleFormat1.PivotCellStyle.BackColor = Color.Red;
        this.pivotGridControl1.TableControl.NewRuleConditionalFormat.Add(newRuleFormat1);
    }
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
        ' Initializing a new rule.
        Dim newRule1 As New NewRuleConditionalFormat()
        ' Formats the pivot cells based on the average values of the cells.
        newRule1.FormateSelectedAverageValueType = FormateSelectedAverageValueType.Below
        ' Make sure to set the rule type as the formating type.
        newRule1.RuleType = RuleType.FormatOnlyValuesThatAreAboveOrBelowAverage
        ' Here "Quantity" is the field-mapping name.
        newRule1.SummaryElement = "Quantity"
        Dim newRuleFormat1 As New PivotGridNewRuleConditionalFormat()
        Dim form As New ConditionalFormat()
        newRuleFormat1.NewRuleCollections.Add(newRule1)' Formating is done.
        newRuleFormat1.PivotCellStyle.BackColor = Color.Red
        Me.pivotGridControl1.TableControl.NewRuleConditionalFormat.Add(newRuleFormat1)
    End Sub

    FormateValuesRankType

    Gets or sets the value of format as rank type.

    Declaration
    public FormateValuesRankType FormateValuesRankType { get; set; }
    Property Value
    Type Description
    FormateValuesRankType
    Examples

    This example shows how to use the FormateValuesRankType property.

    void Form1_Load(object sender, EventArgs e)
    {
        // Initializing a new rule.
        NewRuleConditionalFormat newRule1 = new NewRuleConditionalFormat();
        // Formats the pivot cells based on the rank values of the cells.
        newRule1.FormateValuesRankType = FormateValuesRankType.Bottom;
        // Make sure to set the rule type as the formating type. By default "FormatAllCellsBasedOnTheirValues" is set.
        newRule1.RuleType = RuleType.FormatTopOrBottomRankedValues;
        // Here "Amount" is the field-mapping name.
        newRule1.SummaryElement = "Amount";
        PivotGridNewRuleConditionalFormat newRuleFormat1 = new PivotGridNewRuleConditionalFormat();
        ConditionalFormat form = new ConditionalFormat();
        newRuleFormat1.NewRuleCollections.Add(newRule1);
        // Formating is done.
        newRuleFormat1.PivotCellStyle.BackColor = Color.Red;
        this.pivotGridControl1.TableControl.NewRuleConditionalFormat.Add(newRuleFormat1);
    }
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
        ' Initializing a new rule.
        Dim newRule1 As New NewRuleConditionalFormat()
        ' Formats the pivot cells based on the rank values of the cells.
        newRule1.FormateValuesRankType = FormateValuesRankType.Bottom
        ' Make sure to set the rule type as the formating type. By default "FormatAllCellsBasedOnTheirValues" is set.
        newRule1.RuleType = RuleType.FormatTopOrBottomRankedValues
        ' Here "Amount" is the field-mapping name.
        newRule1.SummaryElement = "Amount"
        Dim newRuleFormat1 As New PivotGridNewRuleConditionalFormat()
        Dim form As New ConditionalFormat()
        newRuleFormat1.NewRuleCollections.Add(newRule1)
        ' Formating is done.
        newRuleFormat1.PivotCellStyle.BackColor = Color.Red
        Me.pivotGridControl1.TableControl.NewRuleConditionalFormat.Add(newRuleFormat1)
    End Sub

    FormatStyle

    Gets or sets the value of the format.

    Declaration
    public FormatStyle FormatStyle { get; set; }
    Property Value
    Type Description
    FormatStyle
    Examples

    This example shows how to use the FormatStyle property.

    void Form1_Load(object sender, EventArgs e)
    {
        // Initializing a new rule.
        NewRuleConditionalFormat newRule1 = new NewRuleConditionalFormat();
        // Formats the pivot cells based on the their values.
        newRule1.FormatStyle = FormatStyle.IconSets;
        // Make sure to set the rule type as the formating type. By default "FormatAllCellsBasedOnTheirValues" is set.
        newRule1.RuleType = RuleType.FormatAllCellsBasedOnTheirValues;
        // Here "Amount" is the field-mapping name.
        newRule1.SummaryElement = "Amount";
        PivotGridNewRuleConditionalFormat newRuleFormat1 = new PivotGridNewRuleConditionalFormat();
        ConditionalFormat form = new ConditionalFormat();
        newRuleFormat1.NewRuleCollections.Add(newRule1);
        this.pivotGridControl1.TableControl.NewRuleConditionalFormat.Add(newRuleFormat1);
    }
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
        ' Initializing a new rule.
        Dim newRule1 As New NewRuleConditionalFormat()
        ' Formats the pivot cells based on the their values.
        newRule1.FormatStyle = FormatStyle.IconSets
        ' Make sure to set the rule type as the formating type. By default "FormatAllCellsBasedOnTheirValues" is set.
        newRule1.RuleType = RuleType.FormatAllCellsBasedOnTheirValues
        ' Here "Amount" is the field-mapping name.
        newRule1.SummaryElement = "Amount"
        Dim newRuleFormat1 As New PivotGridNewRuleConditionalFormat()
        Dim form As New ConditionalFormat()
        newRuleFormat1.NewRuleCollections.Add(newRule1)
        Me.pivotGridControl1.TableControl.NewRuleConditionalFormat.Add(newRuleFormat1)
    End Sub

    IconImage

    Gets or sets the category of image icons.

    Declaration
    public IconImageCategory IconImage { get; set; }
    Property Value
    Type Description
    IconImageCategory

    Image

    Gets or sets the name of the image.

    Declaration
    public BitMapImageName Image { get; set; }
    Property Value
    Type Description
    BitMapImageName

    The ImageName.

    Ranges

    Gets or sets the GridRangeInfo values.

    Declaration
    public GridRangeInfo Ranges { get; set; }
    Property Value
    Type Description
    GridRangeInfo

    RankValue

    Gets or sets the value of the rank.

    Declaration
    public int RankValue { get; set; }
    Property Value
    Type Description
    System.Int32

    RuleType

    Gets or sets the type of rule.

    Declaration
    public RuleType RuleType { get; set; }
    Property Value
    Type Description
    RuleType
    Examples

    This example shows how to use the RuleType property.

    void Form1_Load(object sender, EventArgs e)
    {
        // Initializing a new rule.
        NewRuleConditionalFormat newRule1 = new NewRuleConditionalFormat();
        newRule1.FormateValuesRankType = FormateValuesRankType.Top;
        // Make sure to set the format type as the rule type. By default "FormatAllCellsBasedOnTheirValues" is set.
        newRule1.RuleType = RuleType.FormatTopOrBottomRankedValues;
        // Here "Quantity" is the field-mapping name.
        newRule1.SummaryElement = "Quantity";
        PivotGridNewRuleConditionalFormat newRuleFormat1 = new PivotGridNewRuleConditionalFormat();
        // Formats the pivot cells based on the their values.
        newRuleFormat1.PivotCellStyle.TextColor = Color.White;
        newRuleFormat1.PivotCellStyle.BackColor = Color.Tomato;
        newRuleFormat1.PivotCellStyle.Font.Facename = "Times New Roman";
        newRuleFormat1.PivotCellStyle.Font.Bold = true;
        newRuleFormat1.NewRuleCollections.Add(newRule1);
        this.pivotGridControl1.TableControl.NewRuleConditionalFormat.Add(newRuleFormat1);
    }
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
        ' Initializing a new rule.
        Dim newRule1 As New NewRuleConditionalFormat()
        newRule1.FormateValuesRankType = FormateValuesRankType.Top
        ' Make sure to set the format type as the rule type. By default "FormatAllCellsBasedOnTheirValues" is set.
        newRule1.RuleType = RuleType.FormatTopOrBottomRankedValues
        ' Here "Quantity" is the field-mapping name.
        newRule1.SummaryElement = "Quantity"
        Dim newRuleFormat1 As New PivotGridNewRuleConditionalFormat()
        ' Formats the pivot cells based on the their values.
        newRuleFormat1.PivotCellStyle.TextColor = Color.White
        newRuleFormat1.PivotCellStyle.BackColor = Color.Tomato
        newRuleFormat1.PivotCellStyle.Font.Facename = "Times New Roman"
        newRuleFormat1.PivotCellStyle.Font.Bold = True
        newRuleFormat1.NewRuleCollections.Add(newRule1)
        Me.pivotGridControl1.TableControl.NewRuleConditionalFormat.Add(newRuleFormat1)
    End Sub

    SummaryElement

    Gets or sets the Summary element.

    Declaration
    public string SummaryElement { get; set; }
    Property Value
    Type Description
    System.String
    Examples

    This example shows how to use the SummaryElement property.

    void Form1_Load(object sender, EventArgs e)
    {
        // Initializing a new rule.
        NewRuleConditionalFormat newRule1 = new NewRuleConditionalFormat();
        // Formats the pivot cells based on the rank values of the cells.
        newRule1.FormateValuesRankType = FormateValuesRankType.Bottom;
        // Make sure to set the rule type as the formating type. By default "FormatAllCellsBasedOnTheirValues" is set.
        newRule1.RuleType = RuleType.FormatTopOrBottomRankedValues;
        // Here "Amount" is the field-mapping name. If the summary element is not set, then formatting is not done.
        newRule1.SummaryElement = "Amount";
        PivotGridNewRuleConditionalFormat newRuleFormat1 = new PivotGridNewRuleConditionalFormat();
        newRuleFormat1.NewRuleCollections.Add(newRule1);
        // Formating is done.
        newRuleFormat1.PivotCellStyle.BackColor = Color.Red;
        this.pivotGridControl1.TableControl.NewRuleConditionalFormat.Add(newRuleFormat1);
    }
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
        ' Initializing a new rule.
        Dim newRule1 As New NewRuleConditionalFormat()
        ' Formats the pivot cells based on the rank values of the cells.
        newRule1.FormateValuesRankType = FormateValuesRankType.Bottom
        ' Make sure to set the rule type as the formating type. By default "FormatAllCellsBasedOnTheirValues" is set.
        newRule1.RuleType = RuleType.FormatTopOrBottomRankedValues
        ' Here "Amount" is the field-mapping name. If the summary element is not set, then formatting is not done.
        newRule1.SummaryElement = "Amount"
        Dim newRuleFormat1 As New PivotGridNewRuleConditionalFormat()
        newRuleFormat1.NewRuleCollections.Add(newRule1)
        ' Formating is done.
        newRuleFormat1.PivotCellStyle.BackColor = Color.Red
        Me.pivotGridControl1.TableControl.NewRuleConditionalFormat.Add(newRuleFormat1)
    End Sub

    Value1

    Gets or sets the Value1.

    Declaration
    public double Value1 { get; set; }
    Property Value
    Type Description
    System.Double

    By default values are taken as percent or number and ranked values as top or bottom.

    Value2

    Gets or sets the Value2.

    Declaration
    public double Value2 { get; set; }
    Property Value
    Type Description
    System.Double

    Value3

    Gets or sets the Value3.

    Declaration
    public double Value3 { get; set; }
    Property Value
    Type Description
    System.Double

    Value4

    Gets or sets the Value4.

    Declaration
    public double Value4 { get; set; }
    Property Value
    Type Description
    System.Double

    ValueType1

    Gets or sets the ValueType1.

    Declaration
    public ValueType ValueType1 { get; set; }
    Property Value
    Type Description
    ValueType

    ValueType2

    Gets or sets the ValueType2.

    Declaration
    public ValueType ValueType2 { get; set; }
    Property Value
    Type Description
    ValueType

    ValueType3

    Gets or sets the ValueType3.

    Declaration
    public ValueType ValueType3 { get; set; }
    Property Value
    Type Description
    ValueType

    ValueType4

    Gets or sets the ValueType4.

    Declaration
    public ValueType ValueType4 { get; set; }
    Property Value
    Type Description
    ValueType
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved