Modules/EDMI_ClientSuite/ClassControlData.vb

36 lines
1.3 KiB
VB.net

Imports DevExpress.XtraEditors
Imports DigitalData.Controls.LookupGrid
Imports DigitalData.Modules.Logging
Public Class ClassControlData
Inherits BaseClass
Public Sub New(LogConfig As LogConfig)
MyBase.New(LogConfig)
End Sub
Public Sub LoadControlData(ByRef Controls As List(Of BaseEdit), Data As DataTable)
Dim oCounter = 0
For Each oControl As BaseEdit In Controls
Dim oBindingSource As New BindingSource(Data, Nothing)
Select Case oControl.GetType
Case GetType(TextEdit)
oControl.DataBindings.Add("Text", oBindingSource, "CTRLVALUE", True, DataSourceUpdateMode.OnPropertyChanged)
Case GetType(MemoEdit)
oControl.DataBindings.Add("Text", oBindingSource, "CTRLVALUE", True, DataSourceUpdateMode.OnPropertyChanged)
Case GetType(DateEdit)
oControl.DataBindings.Add("Text", oBindingSource, "CTRLVALUE", True, DataSourceUpdateMode.OnPropertyChanged)
Case GetType(LookupControl2)
oControl.DataBindings.Add("Text", oBindingSource, "CTRLVALUE", True, DataSourceUpdateMode.OnPropertyChanged)
Case Else
End Select
oBindingSource.Position = oCounter
oCounter += 1
Next
End Sub
End Class