This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
/
TreeLookUpOptionsBehavior.vb
93 lines (89 loc) · 3.4 KB
/
TreeLookUpOptionsBehavior.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
' Developer Express Code Central Example:
' How to create an analog of GridLookUpEdit with TreeList in a popup window
'
' In some cases, it is useful to display data within LookUpEdit in the
' hierarchical structure. This can be introduced by creating a custom editor –
' TreeListLookUpEdit. This example illustrates how to create such an editor. Here
' we have implemented the following features:
'
' - The
' RepositoryItemTreeListLookUpEdit.ValueMember and
' RepositoryItemTreeListLookUpEdit.DisplayMember properties. They are intended for
' the same functions as in a regular LookUpEdit/GridLookUpEdit.
' - The
' ProcessNewValue event is implemented like in LookUpEdit/GridLookUpEdit. This
' event is raised when an editor is validated and its display value does not exist
' within an inner TreeList.
' - The property SearchMode allows you to select one of
' the following modes:
' o OnlyInPopup. This mode is an analog of
' IncrementalSearch, but it also expands nodes if it is needed when you type a
' search text. This mode works only if a popup window is shown. o AutoComplete. In
' the Auto Completion mode, the text in the edit box is automatically completed if
' it matches a DisplayMember field value from drop-down nodes.
' o AutoFilter.
' This mode applies a filter to the DisplayMember column. Filter is formed when
' you type a text in the edit box. In addition, it opens a popup window and looks
' for nodes retaining paths to the root to show the context.
' For virtual data
' loading (on demand) in the inner TreeList you can handle its BeforeExpand event.
' Please refer to the following help articles:
'
' How to: Implement Dynamic
' Loading in Unbound Mode
' (ms-help://DevExpress.NETv12.1/DevExpress.WindowsForms/CustomDocument325.htm)
' Dynamic
' Data Loading via Events
' (ms-help://DevExpress.NETv12.1/DevExpress.WindowsForms/CustomDocument5560.htm)
' How
' to: Implement a Tree Structure for a Business Object
' (ms-help://DevExpress.NETv12.1/DevExpress.WindowsForms/CustomDocument5561.htm)
' to learn which virtual Modes TreeList supports.
'
' You can find sample updates and versions for different programming languages here:
' http://www.devexpress.com/example=E4319
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports DevExpress.XtraEditors.Popup
Imports DevExpress.XtraTreeList
Imports DevExpress.XtraEditors
Imports DevExpress.XtraEditors.Filtering
Imports DevExpress.XtraTreeList.Nodes
Imports System.Drawing
Imports System.ComponentModel
Imports System.Windows.Forms
Imports DevExpress.XtraEditors.Controls
Namespace TreeListLookUp
Public Class TreeLookUpOptionsBehavior
Inherits TreeListOptionsBehavior
Public Sub New(ByVal treeList As TreeList)
MyBase.New(treeList)
End Sub
<Browsable(False), EditorBrowsable(EditorBrowsableState.Never)>
Public Shadows Property EnableFiltering() As Boolean
Get
Return MyBase.EnableFiltering
End Get
Set(ByVal value As Boolean)
If EnableFiltering = value Then
Return
End If
MyBase.EnableFiltering = value
End Set
End Property
<Browsable(False), EditorBrowsable(EditorBrowsableState.Never)>
Public Shadows Property AllowIncrementalSearch() As Boolean
Get
Return MyBase.AllowIncrementalSearch
End Get
Set(ByVal value As Boolean)
If AllowIncrementalSearch = value Then
Return
End If
MyBase.AllowIncrementalSearch = value
End Set
End Property
End Class
End Namespace