-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.cs
35 lines (29 loc) · 1.04 KB
/
Form1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System.Windows.Forms;
using DevExpress.XtraPivotGrid;
using DevExpress.XtraEditors;
namespace WinFormsPivotGridFormatRules
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
salesPersonTableAdapter1.Fill(nwindDataSet1.SalesPerson);
// Creates a new FormatRule object.
PivotGridFormatRule newRule = new PivotGridFormatRule();
// Sets a Measure.
newRule.Measure = fieldExtendedPrice1;
// Creates and specifies a new Settings object.
newRule.Settings = new FormatRuleFieldIntersectionSettings{
Column = fieldOrderYear1,
Row = fieldSalesPerson1
};
// Creates a new Rule object and sets its parameters.
newRule.Rule = new FormatConditionRuleDataBar{
PredefinedName = "Yellow Gradient"
};
// Adds the rule to the collection.
pivotGridControl1.FormatRules.Add(newRule);
}
}
}