Class PivotGridNewRuleConditionalFormat
Represents a class that contains set of rules for formatting the PivotGridControl.
Inheritance
Inherited Members
Namespace: Syncfusion.Windows.Forms.PivotAnalysis
Assembly: Syncfusion.PivotAnalysis.Windows.dll
Syntax
public class PivotGridNewRuleConditionalFormat
Constructors
PivotGridNewRuleConditionalFormat()
Initializes a new instance of the PivotGridNewRuleConditionalFormat class.
Declaration
public PivotGridNewRuleConditionalFormat()
Properties
Name
Gets or sets a name to the PivotGridNewRuleConditionalFormat.
Declaration
public string Name { get; set; }
Property Value
Type |
---|
System.String |
Examples
This example shows how to use the Name property.
// Initializing a conditional formatting item.
PivotGridConditionalFormat item = new PivotGridConditionalFormat();
// Assigns the name to the Conditional format being applied.
item.Name = "myCondition";
// Assigning the condition format to the pivot grid.
this.pivotGridControl1.TableControl.ConditionalFormats.Add(item);
' Initializing a conditional formatting item.
Dim item As New PivotGridConditionalFormat()
' Assigns the name to the Conditional format being applied.
item.Name = "myCondition"
' Assigning the condition format to the pivot grid.
Me.pivotGridControl1.TableControl.ConditionalFormats.Add(item)
NewRuleCollections
Gets or sets the collection of NewRuleConditionalFormat.
Declaration
public ObservableCollection<NewRuleConditionalFormat> NewRuleCollections { get; set; }
Property Value
Type |
---|
System.Collections.ObjectModel.ObservableCollection<NewRuleConditionalFormat> |
Examples
This example shows how to use NewRuleCollections property.
// Initializing a new rule for formatting.
PivotGridNewRuleConditionalFormat newRuleFormat1 = new PivotGridNewRuleConditionalFormat();
// Adding the newly created rule to the collections.
newRuleFormat1.NewRuleCollections.Add(newRule1);
// The new rule gets associated with the pivot grid.
this.pivotGridControl1.TableControl.NewRuleConditionalFormat.Add(newRuleFormat1);
' Initializing a new rule for formatting.
Dim newRuleFormat1 As New PivotGridNewRuleConditionalFormat()
' Adding the newly created rule to the collections.
newRuleFormat1.NewRuleCollections.Add(newRule1)
' The new rule gets associated with the pivot grid.
Me.pivotGridControl1.TableControl.NewRuleConditionalFormat.Add(newRuleFormat1)
PivotCellInfo
Gets or sets the PivotCellInfo instance value that holds the pivot cell information.
Declaration
public PivotCellInfo PivotCellInfo { get; set; }
Property Value
Type |
---|
PivotCellInfo |
Examples
This example shows how to use the PivotCellInfo property.
// Initializing a new rule for formatting.
PivotGridNewRuleConditionalFormat newRuleFormat1 = new PivotGridNewRuleConditionalFormat();
// Adding the newly created rule to the collections.
newRuleFormat1.NewRuleCollections.Add(newRule1);
// Provides the pivot grid's cell information.
newRuleFormat1.PivotCellInfo.CellType = PivotCellType.HeaderCell;
newRuleFormat1.PivotCellInfo.ColumnIndex = 4;
// The new rule gets associated with the pivot grid.
this.pivotGridControl1.TableControl.NewRuleConditionalFormat.Add(newRuleFormat1);
' Initializing a new rule for formatting.
Dim newRuleFormat1 As New PivotGridNewRuleConditionalFormat()
' Adding the newly created rule to the collections.
newRuleFormat1.NewRuleCollections.Add(newRule1)
' Provides the pivot grid's cell information.
newRuleFormat1.PivotCellInfo.CellType = PivotCellType.HeaderCell
newRuleFormat1.PivotCellInfo.ColumnIndex = 4
' The new rule gets associated with the pivot grid.
Me.pivotGridControl1.TableControl.NewRuleConditionalFormat.Add(newRuleFormat1)
PivotCellStyle
Gets or sets the style of a pivot cell.
Declaration
public GridStyleInfo PivotCellStyle { get; set; }
Property Value
Type |
---|
GridStyleInfo |
Examples
This example shows how to use the PivotCellStyle property.
void Form1_Load(object sender, EventArgs e)
{
// Initializing a new rule.
NewRuleConditionalFormat newRule1 = new NewRuleConditionalFormat();
newRule1.RuleType = RuleType.FormatOnlyUniqueOrDuplicateValues;
newRule1.FormatAllType = FormatAllType.Duplicate;
newRule1.SummaryElement = "Quantity";
PivotGridNewRuleConditionalFormat newRuleFormat1 = new PivotGridNewRuleConditionalFormat();
ConditionalFormat form = new ConditionalFormat();
newRuleFormat1.NewRuleCollections.Add(newRule1);
// Formats the pivot cells that satisfies the RuleType and Formats the cells which have repeated values.
newRuleFormat1.PivotCellStyle.BackColor = Color.Red;
newRuleFormat1.PivotCellStyle.TextColor = Color.White;
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.RuleType = RuleType.FormatOnlyUniqueOrDuplicateValues
newRule1.FormatAllType = FormatAllType.Duplicate
newRule1.SummaryElement = "Quantity"
Dim newRuleFormat1 As New PivotGridNewRuleConditionalFormat()
Dim form As New ConditionalFormat()
newRuleFormat1.NewRuleCollections.Add(newRule1)
' Formats the pivot cells that satisfies the RuleType and Formats the cells which have repeated values.
newRuleFormat1.PivotCellStyle.BackColor = Color.Red
newRuleFormat1.PivotCellStyle.TextColor = Color.White
Me.pivotGridControl1.TableControl.NewRuleConditionalFormat.Add(newRuleFormat1)
End Sub
Methods
Clone()
Creates a copy of this descriptor.
Declaration
public PivotGridNewRuleConditionalFormat Clone()
Returns
Type | Description |
---|---|
PivotGridNewRuleConditionalFormat | A copy of this descriptor. |
InitializeFrom(PivotGridNewRuleConditionalFormat)
Initializes this object and copies properties from another object. System.ComponentModel.INotifyPropertyChanging and System.ComponentModel.INotifyPropertyChanged events are raised for every property that is modified. If both objects are equal, no events are raised.
Declaration
public void InitializeFrom(PivotGridNewRuleConditionalFormat other)
Parameters
Type | Name | Description |
---|---|---|
PivotGridNewRuleConditionalFormat | other | The source object. |
ResetStyle()
Resets the style information of the PivotCellStyle property.
Declaration
public void ResetStyle()
ShouldSerializeStyle()
Determines whether the style information has been set and should be serialized into code at design-time or not.
Declaration
public bool ShouldSerializeStyle()
Returns
Type | Description |
---|---|
System.Boolean | true, if the style information has been set; otherwise, false. The default value is false. |
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A string value that represents the current object. |