This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.vb
70 lines (59 loc) · 2.55 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Imports System
Imports System.Collections.Generic
Imports System.Data
Imports System.Windows.Forms
Imports DevExpress.Data
Imports DevExpress.Sparkline
Imports DevExpress.XtraEditors.Repository
Imports DevExpress.XtraGrid.Columns
Imports DevExpress.XtraGrid.Views.Base
' ...
Public Class Form1
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) _
Handles MyBase.Load
' Fill a grid's data source.
Me.CustomersPaymentTableAdapter.Fill(Me.ContactsDataSet.CustomersPayment)
' Create a Sparkline repository item, adjust it and add it to the grid's repository.
Dim repositoryItemSparklineEdit1 As New RepositoryItemSparklineEdit()
Dim sparklineView As SparklineViewBase = repositoryItemSparklineEdit1.View
sparklineView.HighlightEndPoint = True
sparklineView.HighlightMaxPoint = True
sparklineView.HighlightMinPoint = True
sparklineView.HighlightStartPoint = True
Me.GridControl1.RepositoryItems.Add(repositoryItemSparklineEdit1)
' Create an unbound column, adjust it and add it to the grid view.
Dim colPayments As New GridColumn()
colPayments.Visible = True
colPayments.Caption = "Payments"
colPayments.UnboundType = UnboundColumnType.Object
colPayments.ColumnEdit = repositoryItemSparklineEdit1
colPayments.FieldName = "gridColumn1"
colPayments.MaxWidth = 300
colPayments.MinWidth = 50
colPayments.Width = 255
Me.GridView1.Columns.Add(colPayments)
' Expand all groups for better initial navigation.
Me.GridView1.ExpandAllGroups()
End Sub
Private Sub gridView1_CustomUnboundColumnData(ByVal sender As Object, ByVal e As CustomColumnDataEventArgs) _
Handles GridView1.CustomUnboundColumnData
'Obtaining data for the sparkline editor.
If e.IsGetData Then
Dim values As New List(Of Double)()
Dim row As DataRowView = CType(e.Row, DataRowView)
values.Add(CDbl(row("January")))
values.Add(CDbl(row("February")))
values.Add(CDbl(row("March")))
values.Add(CDbl(row("April")))
values.Add(CDbl(row("May")))
values.Add(CDbl(row("June")))
values.Add(CDbl(row("July")))
values.Add(CDbl(row("August")))
values.Add(CDbl(row("September")))
values.Add(CDbl(row("October")))
values.Add(CDbl(row("November")))
values.Add(CDbl(row("December")))
e.Value = values
End If
End Sub
End Class