-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForm1.cs
More file actions
26 lines (24 loc) · 984 Bytes
/
Form1.cs
File metadata and controls
26 lines (24 loc) · 984 Bytes
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
using System;
using System.Windows.Forms;
using DevExpress.XtraPivotGrid;
namespace WinFormsPivotCustomCellDisplayText {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
salesPersonTableAdapter1.Fill(nwindDataSet1.SalesPerson);
fieldCountry.FilterValues.FilterType = PivotFilterType.Included;
fieldCountry.FilterValues.Add("UK");
}
private void pivotGridControl1_CustomCellDisplayText(object sender,
DevExpress.XtraPivotGrid.PivotCellDisplayTextEventArgs e) {
if (e.RowValueType == PivotGridValueType.Total ||
e.ColumnValueType != PivotGridValueType.Total) return;
if (Convert.ToSingle(e.Value) < 2000)
e.DisplayText = "Low";
else if (Convert.ToSingle(e.Value) > 6000)
e.DisplayText = "High";
else
e.DisplayText = "Middle";
}
}
}