/
Form1.vb
36 lines (31 loc) · 1.58 KB
/
Form1.vb
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
36
Imports DevExpress.DashboardCommon
Namespace Grid_ExpressionCondition
Partial Public Class Form1
Inherits DevExpress.XtraEditors.XtraForm
Public Sub New()
InitializeComponent()
Dim dashboard As New Dashboard()
dashboard.LoadFromXml("..\..\Data\Dashboard.xml")
dashboardViewer1.Dashboard = dashboard
Dim grid As GridDashboardItem =
CType(dashboard.Items("gridDashboardItem1"), GridDashboardItem)
Dim extendedPrice As GridMeasureColumn = CType(grid.Columns(1), GridMeasureColumn)
extendedPrice.Measure.UniqueId = "extendedPrice"
Dim priceParameter As New DashboardParameter()
priceParameter.LookUpSettings = Nothing
priceParameter.Name = "priceParameter"
priceParameter.Type = GetType(Decimal)
priceParameter.Value = 150000
priceParameter.Description = "Format values that are greater than"
dashboard.Parameters.Add(priceParameter)
Dim greaterThanRule As New GridItemFormatRule(extendedPrice)
Dim greaterThanCondition As New FormatConditionExpression()
greaterThanCondition.Expression = "extendedPrice > [Parameters.priceParameter]"
greaterThanCondition.StyleSettings =
New AppearanceSettings(FormatConditionAppearanceType.PaleGreen)
greaterThanRule.ApplyToRow = True
greaterThanRule.Condition = greaterThanCondition
grid.FormatRules.AddRange(greaterThanRule)
End Sub
End Class
End Namespace