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
/
MyGridView.vb
62 lines (51 loc) · 1.4 KB
/
MyGridView.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
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports DevExpress.XtraGrid.Views.Grid
Imports DevExpress.XtraGrid
Imports DevExpress.XtraGrid.Registrator
Imports DevExpress.XtraGrid.Views.Base
Namespace Q131966
Public Class MyGridView
Inherits GridView
Public Sub New(ByVal control As GridControl)
MyBase.New(control)
End Sub
Public Sub New()
Me.New(Nothing)
End Sub
Protected Overrides ReadOnly Property ViewName() As String
Get
Return "MyGridView"
End Get
End Property
Protected Overrides Function GenerateColumnName(ByVal fieldName As String) As String
Dim s As String = MyBase.GenerateColumnName(fieldName)
Return s.Replace("col", String.Empty)
End Function
End Class
Public Class MyGridInfoRegistrator
Inherits GridInfoRegistrator
Public Sub New()
MyBase.New()
End Sub
Public Overrides ReadOnly Property ViewName() As String
Get
Return "MyGridView"
End Get
End Property
Public Overrides Function CreateView(ByVal grid As GridControl) As BaseView
Return New MyGridView(grid)
End Function
End Class
Public Class MyGridControl
Inherits GridControl
Public Sub New()
MyBase.New()
End Sub
Protected Overrides Sub RegisterAvailableViewsCore(ByVal collection As InfoCollection)
MyBase.RegisterAvailableViewsCore(collection)
collection.Add(New MyGridInfoRegistrator())
End Sub
End Class
End Namespace