This repository has been archived by the owner on Sep 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyEmbeddedNavigator.vb
72 lines (67 loc) · 2.13 KB
/
MyEmbeddedNavigator.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
71
72
Imports Microsoft.VisualBasic
Imports System
Imports System.ComponentModel
Imports System.Windows.Forms
Imports DevExpress.XtraEditors
Imports DevExpress.XtraEditors.NavigatorButtons
Imports DevExpress.XtraGrid
Namespace CustomNavigator
Public Class MyGridControl
Inherits GridControl
Protected Overrides Function CreateEmbeddedNavigator() As ControlNavigator
Dim nav As GridControlNavigator = New MyEmbeddedNavigator(Me)
AddHandler nav.SizeChanged, AddressOf OnEmbeddedNavigator_SizeChanged
nav.Visible = False
nav.TabStop = False
Return nav
End Function
End Class
Public Class MyEmbeddedNavigator
Inherits GridControlNavigator
Public Sub New(ByVal control As GridControl)
MyBase.New(control)
End Sub
Protected Overrides Function CreateButtons() As NavigatorButtonsBase
Return New MyNavigatorButtons(Me)
End Function
End Class
<TypeConverter("System.ComponentModel.ExpandableObjectConverter, System")> _
Public Class MyNavigatorButtons
Inherits ControlNavigatorButtons
Public Sub New(ByVal owner As INavigatorOwner)
MyBase.New(owner)
End Sub
Protected Overrides Function CreateNavigatorButtonCollection() As NavigatorButtonCollectionBase
Return New MyNavigatorButtonCollection(Me)
End Function
End Class
Public Class MyNavigatorButtonCollection
Inherits ControlNavigatorButtonCollection
Public Sub New(ByVal buttons As NavigatorButtonsBase)
MyBase.New(buttons)
End Sub
Protected Overrides Sub CreateButtons(ByVal buttons As NavigatorButtonsBase)
MyBase.CreateButtons(buttons)
AddButton(New MyNavigatorCustomButtonHelper(buttons))
End Sub
End Class
Public Class MyNavigatorCustomButtonHelper
Inherits ControlNavigatorButtonHelperBase
Public Sub New(ByVal buttons As NavigatorButtonsBase)
MyBase.New(buttons)
End Sub
Public Overrides ReadOnly Property ButtonType() As NavigatorButtonType
Get
Return NavigatorButtonType.Custom
End Get
End Property
Public Overrides ReadOnly Property Enabled() As Boolean
Get
Return True
End Get
End Property
Protected Overrides Sub DoDataClick()
MessageBox.Show("Custom button action")
End Sub
End Class
End Namespace