This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
/
Form1.vb
68 lines (54 loc) · 1.62 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
Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Imports System.Reflection
Namespace WindowsApplication1
Partial Public Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
list = New BindingList(Of MyObject)()
For i As Integer = 0 To 9
list.Add(New MyObject(i.ToString()))
Next i
gridControl1.DataSource = list
End Sub
Private list As BindingList(Of MyObject)
Private Sub simpleButton1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles simpleButton1.Click
Using f As New XtraForm1(list)
f.BindingContext = Me.BindingContext
If f.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK Then
Dim cm As CurrencyManager = CType(Me.BindingContext(list), CurrencyManager)
cm.EndCurrentEdit()
End If
End Using
End Sub
End Class
Public Class MyObject
Implements INotifyPropertyChanged
Public Sub New(ByVal str As String)
field_Renamed = str
End Sub
Private field_Renamed As String
Public Property Field() As String
Get
Return field_Renamed
End Get
Set(ByVal value As String)
field_Renamed = value
NotifyPropertyChanged("Field")
End Set
End Property
#Region "INotifyPropertyChanged Members"
Private Sub NotifyPropertyChanged(ByVal info As String)
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(info))
End Sub
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
#End Region
End Class
End Namespace