Move to LookupControl3 for Globix
This commit is contained in:
parent
a34c29d8e2
commit
21bf3a7d32
@ -2,8 +2,8 @@
|
||||
Imports System.Drawing
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Language.Utils
|
||||
Imports DigitalData.Controls.LookupGrid
|
||||
Imports DevExpress.XtraEditors
|
||||
Imports DigitalData.Controls.LookupGrid
|
||||
|
||||
Public Class ControlCreator
|
||||
Private Form As Form
|
||||
@ -171,11 +171,8 @@ Public Class ControlCreator
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function AddLookupControl(pIndexname As String, pY As Integer, pMultiselect As Boolean, pDataType As String, pSQLCommand As String, pConnectionId As Integer, Optional pDefaultValue As String = "", Optional pAddNewValues As Boolean = False, Optional pPreventDuplicateValues As Boolean = False)
|
||||
Dim oControl As New LookupControl2 With {
|
||||
.MultiSelect = pMultiselect,
|
||||
.AllowAddNewValues = pAddNewValues,
|
||||
.PreventDuplicates = pPreventDuplicateValues,
|
||||
Public Function AddLookupControl(pIndexname As String, pY As Integer, pMultiselect As Boolean, pDataType As String, pSQLCommand As String, pConnectionId As Integer, Optional pDefaultValue As String = "", Optional pAddNewValues As Boolean = False, Optional pPreventDuplicateValues As Boolean = False) As LookupControl3
|
||||
Dim oControl As New LookupControl3 With {
|
||||
.Location = New Point(DEFAULT_POSITION_X, pY),
|
||||
.Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT),
|
||||
.Name = "cmbMulti" & pIndexname,
|
||||
@ -184,6 +181,10 @@ Public Class ControlCreator
|
||||
.IndexType = pDataType
|
||||
}
|
||||
}
|
||||
|
||||
oControl.Properties.MultiSelect = pMultiselect
|
||||
oControl.Properties.AllowAddNewValues = pAddNewValues
|
||||
oControl.Properties.PreventDuplicates = pPreventDuplicateValues
|
||||
oControl.Properties.AppearanceFocused.BackColor = HightlightColor
|
||||
|
||||
If Not String.IsNullOrEmpty(pDefaultValue) Then
|
||||
@ -200,18 +201,27 @@ Public Class ControlCreator
|
||||
Select(Function(item) item.Trim()).
|
||||
ToList()
|
||||
End If
|
||||
oControl.SelectedValues = oDefaultValues
|
||||
oControl.Properties.SelectedValues = oDefaultValues
|
||||
End If
|
||||
|
||||
AddHandler oControl.SelectedValuesChanged, Sub() OnControlChanged.Invoke(oControl)
|
||||
AddHandler oControl.Properties.SelectedValuesChanged, Sub() OnControlChanged.Invoke(oControl)
|
||||
|
||||
If OnLookupData Is Nothing Then
|
||||
Logger.Warn("LookupGrid Datasource could not be set, OnLookupData Function is not defined!")
|
||||
End If
|
||||
|
||||
Try
|
||||
Dim oDataSource = OnLookupData.Invoke(oControl, pSQLCommand, pConnectionId)
|
||||
oControl.DataSource = oDataSource
|
||||
If pSQLCommand IsNot Nothing AndAlso pSQLCommand.Length > 0 Then
|
||||
Dim oDataSource = OnLookupData.Invoke(oControl, pSQLCommand, pConnectionId)
|
||||
oControl.Properties.DataSource = oDataSource
|
||||
|
||||
If oDataSource IsNot Nothing AndAlso oDataSource.Columns.Count > 0 Then
|
||||
oControl.Properties.DisplayMember = oDataSource.Columns.Item(0).ColumnName
|
||||
oControl.Properties.ValueMember = oDataSource.Columns.Item(0).ColumnName
|
||||
Else
|
||||
Logger.Warn("Lookup {0} Datasource did not contain any columns!", oControl.Name)
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
|
||||
103
GUIs.Test.TestGUI/frmLookup.Designer.vb
generated
103
GUIs.Test.TestGUI/frmLookup.Designer.vb
generated
@ -22,21 +22,41 @@ Partial Class frmLookup
|
||||
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
|
||||
<System.Diagnostics.DebuggerStepThrough()>
|
||||
Private Sub InitializeComponent()
|
||||
Dim EditorButtonImageOptions4 As DevExpress.XtraEditors.Controls.EditorButtonImageOptions = New DevExpress.XtraEditors.Controls.EditorButtonImageOptions()
|
||||
Dim SerializableAppearanceObject13 As DevExpress.Utils.SerializableAppearanceObject = New DevExpress.Utils.SerializableAppearanceObject()
|
||||
Dim SerializableAppearanceObject14 As DevExpress.Utils.SerializableAppearanceObject = New DevExpress.Utils.SerializableAppearanceObject()
|
||||
Dim SerializableAppearanceObject15 As DevExpress.Utils.SerializableAppearanceObject = New DevExpress.Utils.SerializableAppearanceObject()
|
||||
Dim SerializableAppearanceObject16 As DevExpress.Utils.SerializableAppearanceObject = New DevExpress.Utils.SerializableAppearanceObject()
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmLookup))
|
||||
Dim EditorButtonImageOptions1 As DevExpress.XtraEditors.Controls.EditorButtonImageOptions = New DevExpress.XtraEditors.Controls.EditorButtonImageOptions()
|
||||
Dim SerializableAppearanceObject1 As DevExpress.Utils.SerializableAppearanceObject = New DevExpress.Utils.SerializableAppearanceObject()
|
||||
Dim SerializableAppearanceObject2 As DevExpress.Utils.SerializableAppearanceObject = New DevExpress.Utils.SerializableAppearanceObject()
|
||||
Dim SerializableAppearanceObject3 As DevExpress.Utils.SerializableAppearanceObject = New DevExpress.Utils.SerializableAppearanceObject()
|
||||
Dim SerializableAppearanceObject4 As DevExpress.Utils.SerializableAppearanceObject = New DevExpress.Utils.SerializableAppearanceObject()
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmLookup))
|
||||
Dim EditorButtonImageOptions2 As DevExpress.XtraEditors.Controls.EditorButtonImageOptions = New DevExpress.XtraEditors.Controls.EditorButtonImageOptions()
|
||||
Dim SerializableAppearanceObject5 As DevExpress.Utils.SerializableAppearanceObject = New DevExpress.Utils.SerializableAppearanceObject()
|
||||
Dim SerializableAppearanceObject6 As DevExpress.Utils.SerializableAppearanceObject = New DevExpress.Utils.SerializableAppearanceObject()
|
||||
Dim SerializableAppearanceObject7 As DevExpress.Utils.SerializableAppearanceObject = New DevExpress.Utils.SerializableAppearanceObject()
|
||||
Dim SerializableAppearanceObject8 As DevExpress.Utils.SerializableAppearanceObject = New DevExpress.Utils.SerializableAppearanceObject()
|
||||
Me.GridControl1 = New DevExpress.XtraGrid.GridControl()
|
||||
Me.GridView1 = New DevExpress.XtraGrid.Views.Grid.GridView()
|
||||
Me.GridColumn1 = New DevExpress.XtraGrid.Columns.GridColumn()
|
||||
Me.LookupControl31 = New DigitalData.Controls.LookupGrid.LookupControl3()
|
||||
Me.LookupControl31View = New DevExpress.XtraGrid.Views.Grid.GridView()
|
||||
Me.LookupControl32 = New DigitalData.Controls.LookupGrid.LookupControl3()
|
||||
Me.GridView2 = New DevExpress.XtraGrid.Views.Grid.GridView()
|
||||
Me.LookupControl33 = New DigitalData.Controls.LookupGrid.LookupControl3()
|
||||
Me.GridView3 = New DevExpress.XtraGrid.Views.Grid.GridView()
|
||||
Me.Label1 = New System.Windows.Forms.Label()
|
||||
Me.Label2 = New System.Windows.Forms.Label()
|
||||
CType(Me.GridControl1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.GridView1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.LookupControl31.Properties, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.LookupControl31View, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.LookupControl32.Properties, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.GridView2, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.LookupControl33.Properties, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.GridView3, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'GridControl1
|
||||
@ -63,11 +83,11 @@ Partial Class frmLookup
|
||||
'
|
||||
'LookupControl31
|
||||
'
|
||||
Me.LookupControl31.Location = New System.Drawing.Point(562, 116)
|
||||
Me.LookupControl31.Location = New System.Drawing.Point(631, 12)
|
||||
Me.LookupControl31.Name = "LookupControl31"
|
||||
Me.LookupControl31.Properties.ActionButtonIndex = 1
|
||||
Me.LookupControl31.Properties.AllowAddNewValues = True
|
||||
Me.LookupControl31.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Search, "", 20, True, True, False, EditorButtonImageOptions1, New DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), SerializableAppearanceObject1, SerializableAppearanceObject2, SerializableAppearanceObject3, SerializableAppearanceObject4, "", "openLookupForm", Nothing, DevExpress.Utils.ToolTipAnchor.[Default]), New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)})
|
||||
Me.LookupControl31.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Search, "", 20, True, True, False, EditorButtonImageOptions4, New DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), SerializableAppearanceObject13, SerializableAppearanceObject14, SerializableAppearanceObject15, SerializableAppearanceObject16, "", "openLookupForm", Nothing, DevExpress.Utils.ToolTipAnchor.[Default]), New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)})
|
||||
Me.LookupControl31.Properties.MultiSelect = True
|
||||
Me.LookupControl31.Properties.PopupView = Me.LookupControl31View
|
||||
Me.LookupControl31.Properties.PreventDuplicates = False
|
||||
@ -83,11 +103,77 @@ Partial Class frmLookup
|
||||
Me.LookupControl31View.OptionsSelection.EnableAppearanceFocusedCell = False
|
||||
Me.LookupControl31View.OptionsView.ShowGroupPanel = False
|
||||
'
|
||||
'LookupControl32
|
||||
'
|
||||
Me.LookupControl32.Location = New System.Drawing.Point(631, 38)
|
||||
Me.LookupControl32.Name = "LookupControl32"
|
||||
Me.LookupControl32.Properties.ActionButtonIndex = 1
|
||||
Me.LookupControl32.Properties.AllowAddNewValues = True
|
||||
Me.LookupControl32.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Search, "", 20, True, True, False, EditorButtonImageOptions1, New DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), SerializableAppearanceObject1, SerializableAppearanceObject2, SerializableAppearanceObject3, SerializableAppearanceObject4, "", "openLookupForm", Nothing, DevExpress.Utils.ToolTipAnchor.[Default]), New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)})
|
||||
Me.LookupControl32.Properties.MultiSelect = True
|
||||
Me.LookupControl32.Properties.PopupView = Me.GridView2
|
||||
Me.LookupControl32.Properties.PreventDuplicates = False
|
||||
Me.LookupControl32.Properties.ReadOnly = False
|
||||
Me.LookupControl32.Properties.SelectedValues = CType(resources.GetObject("LookupControl32.Properties.SelectedValues"), System.Collections.Generic.List(Of String))
|
||||
Me.LookupControl32.Size = New System.Drawing.Size(157, 20)
|
||||
Me.LookupControl32.TabIndex = 2
|
||||
'
|
||||
'GridView2
|
||||
'
|
||||
Me.GridView2.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus
|
||||
Me.GridView2.Name = "GridView2"
|
||||
Me.GridView2.OptionsSelection.EnableAppearanceFocusedCell = False
|
||||
Me.GridView2.OptionsView.ShowGroupPanel = False
|
||||
'
|
||||
'LookupControl33
|
||||
'
|
||||
Me.LookupControl33.Location = New System.Drawing.Point(631, 64)
|
||||
Me.LookupControl33.Name = "LookupControl33"
|
||||
Me.LookupControl33.Properties.ActionButtonIndex = 1
|
||||
Me.LookupControl33.Properties.AllowAddNewValues = True
|
||||
Me.LookupControl33.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Search, "", 20, True, True, False, EditorButtonImageOptions2, New DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), SerializableAppearanceObject5, SerializableAppearanceObject6, SerializableAppearanceObject7, SerializableAppearanceObject8, "", "openLookupForm", Nothing, DevExpress.Utils.ToolTipAnchor.[Default]), New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)})
|
||||
Me.LookupControl33.Properties.MultiSelect = True
|
||||
Me.LookupControl33.Properties.PopupView = Me.GridView3
|
||||
Me.LookupControl33.Properties.PreventDuplicates = False
|
||||
Me.LookupControl33.Properties.ReadOnly = False
|
||||
Me.LookupControl33.Properties.SelectedValues = CType(resources.GetObject("LookupControl33.Properties.SelectedValues"), System.Collections.Generic.List(Of String))
|
||||
Me.LookupControl33.Size = New System.Drawing.Size(157, 20)
|
||||
Me.LookupControl33.TabIndex = 2
|
||||
'
|
||||
'GridView3
|
||||
'
|
||||
Me.GridView3.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus
|
||||
Me.GridView3.Name = "GridView3"
|
||||
Me.GridView3.OptionsSelection.EnableAppearanceFocusedCell = False
|
||||
Me.GridView3.OptionsView.ShowGroupPanel = False
|
||||
'
|
||||
'Label1
|
||||
'
|
||||
Me.Label1.AutoSize = True
|
||||
Me.Label1.Location = New System.Drawing.Point(509, 15)
|
||||
Me.Label1.Name = "Label1"
|
||||
Me.Label1.Size = New System.Drawing.Size(93, 13)
|
||||
Me.Label1.TabIndex = 3
|
||||
Me.Label1.Text = "MultiSelect = True"
|
||||
'
|
||||
'Label2
|
||||
'
|
||||
Me.Label2.AutoSize = True
|
||||
Me.Label2.Location = New System.Drawing.Point(509, 41)
|
||||
Me.Label2.Name = "Label2"
|
||||
Me.Label2.Size = New System.Drawing.Size(96, 13)
|
||||
Me.Label2.TabIndex = 3
|
||||
Me.Label2.Text = "MultiSelect = False"
|
||||
'
|
||||
'frmLookup
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(800, 450)
|
||||
Me.Controls.Add(Me.Label2)
|
||||
Me.Controls.Add(Me.Label1)
|
||||
Me.Controls.Add(Me.LookupControl33)
|
||||
Me.Controls.Add(Me.LookupControl32)
|
||||
Me.Controls.Add(Me.LookupControl31)
|
||||
Me.Controls.Add(Me.GridControl1)
|
||||
Me.Name = "frmLookup"
|
||||
@ -96,7 +182,12 @@ Partial Class frmLookup
|
||||
CType(Me.GridView1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.LookupControl31.Properties, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.LookupControl31View, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.LookupControl32.Properties, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.GridView2, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.LookupControl33.Properties, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.GridView3, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
End Sub
|
||||
Friend WithEvents GridControl1 As DevExpress.XtraGrid.GridControl
|
||||
@ -104,4 +195,10 @@ Partial Class frmLookup
|
||||
Friend WithEvents GridColumn1 As DevExpress.XtraGrid.Columns.GridColumn
|
||||
Friend WithEvents LookupControl31 As DigitalData.Controls.LookupGrid.LookupControl3
|
||||
Friend WithEvents LookupControl31View As DevExpress.XtraGrid.Views.Grid.GridView
|
||||
Friend WithEvents LookupControl32 As DigitalData.Controls.LookupGrid.LookupControl3
|
||||
Friend WithEvents GridView2 As DevExpress.XtraGrid.Views.Grid.GridView
|
||||
Friend WithEvents LookupControl33 As DigitalData.Controls.LookupGrid.LookupControl3
|
||||
Friend WithEvents GridView3 As DevExpress.XtraGrid.Views.Grid.GridView
|
||||
Friend WithEvents Label1 As Label
|
||||
Friend WithEvents Label2 As Label
|
||||
End Class
|
||||
|
||||
@ -124,6 +124,24 @@
|
||||
PTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUB
|
||||
AAAAMFN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpc3RgMVtbU3lzdGVtLlN0cmluZwMAAAAGX2l0
|
||||
ZW1zBV9zaXplCF92ZXJzaW9uBgAACAgCAAAACQMAAAAAAAAAAAAAABEDAAAAAAAAAAs=
|
||||
</value>
|
||||
</data>
|
||||
<data name="LookupControl32.Properties.SelectedValues" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAJoBbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1u
|
||||
ZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0sIG1zY29ybGliLCBWZXJzaW9u
|
||||
PTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUB
|
||||
AAAAMFN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpc3RgMVtbU3lzdGVtLlN0cmluZwMAAAAGX2l0
|
||||
ZW1zBV9zaXplCF92ZXJzaW9uBgAACAgCAAAACQMAAAAAAAAAAAAAABEDAAAAAAAAAAs=
|
||||
</value>
|
||||
</data>
|
||||
<data name="LookupControl33.Properties.SelectedValues" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAJoBbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1u
|
||||
ZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0sIG1zY29ybGliLCBWZXJzaW9u
|
||||
PTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUB
|
||||
AAAAMFN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpc3RgMVtbU3lzdGVtLlN0cmluZwMAAAAGX2l0
|
||||
ZW1zBV9zaXplCF92ZXJzaW9uBgAACAgCAAAACQMAAAAAAAAAAAAAABEDAAAAAAAAAAs=
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
||||
@ -12,6 +12,12 @@ Public Class frmLookup
|
||||
LookupControl31.Properties.DataSource = oTable
|
||||
LookupControl31.Properties.ValueMember = oTable.Columns.Item(0).ColumnName
|
||||
LookupControl31.Properties.DisplayMember = oTable.Columns.Item(0).ColumnName
|
||||
LookupControl32.Properties.MultiSelect = True
|
||||
|
||||
LookupControl32.Properties.DataSource = oTable
|
||||
LookupControl32.Properties.ValueMember = oTable.Columns.Item(0).ColumnName
|
||||
LookupControl32.Properties.DisplayMember = oTable.Columns.Item(0).ColumnName
|
||||
LookupControl32.Properties.MultiSelect = False
|
||||
|
||||
Dim oEditor As New LookupControl3
|
||||
GridControl1.DataSource = New List(Of String) From {"foo", "var"}
|
||||
@ -46,4 +52,8 @@ Public Class frmLookup
|
||||
|
||||
Return oDatatable
|
||||
End Function
|
||||
|
||||
Private Sub LookupControl32_EditValueChanged(sender As Object, e As EventArgs) Handles LookupControl32.EditValueChanged, LookupControl33.EditValueChanged
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@ -67,10 +67,7 @@ Public Class GlobixControls
|
||||
Try
|
||||
Dim oSql As String = sql_Vorschlag
|
||||
Dim oConnectionString As String
|
||||
Dim oControl As New DigitalData.Controls.LookupGrid.LookupControl2 With {
|
||||
.Multiselect = Multiselect,
|
||||
.AllowAddNewValues = AddNewValues,
|
||||
.PreventDuplicates = PreventDuplicateValues,
|
||||
Dim oControl As New LookupControl3 With {
|
||||
.Location = New Point(11, y),
|
||||
.Size = New Size(300, 27),
|
||||
.Name = "cmbMulti" & indexname,
|
||||
@ -79,6 +76,10 @@ Public Class GlobixControls
|
||||
.IndexType = DataType
|
||||
}
|
||||
}
|
||||
|
||||
oControl.Properties.MultiSelect = Multiselect
|
||||
oControl.Properties.AllowAddNewValues = AddNewValues
|
||||
oControl.Properties.PreventDuplicates = PreventDuplicateValues
|
||||
oControl.Properties.AppearanceFocused.BackColor = Color.LightGray
|
||||
|
||||
If Not String.IsNullOrEmpty(Vorgabe) Then
|
||||
@ -95,10 +96,10 @@ Public Class GlobixControls
|
||||
Select(Function(item) item.Trim()).
|
||||
ToList()
|
||||
End If
|
||||
oControl.SelectedValues = oDefaultValues
|
||||
oControl.Properties.SelectedValues = oDefaultValues
|
||||
End If
|
||||
|
||||
AddHandler oControl.SelectedValuesChanged, AddressOf Lookup_SelectedValuesChanged
|
||||
AddHandler oControl.Properties.SelectedValuesChanged, AddressOf Lookup_SelectedValuesChanged
|
||||
|
||||
oConnectionString = My.Database.Get_ConnectionStringforID(conid)
|
||||
|
||||
@ -109,7 +110,7 @@ Public Class GlobixControls
|
||||
_Logger.Debug("sql enthält Platzhalter und wird erst während der Laufzeit gefüllt!", False)
|
||||
Else
|
||||
Dim oDatatable = My.Database.GetDatatableWithConnection(oSql, oConnectionString)
|
||||
oControl.DataSource = oDatatable
|
||||
oControl.Properties.DataSource = oDatatable
|
||||
End If
|
||||
Else
|
||||
_Logger.Warn("Connection String for control [{0}] is empty!", oControl.Name)
|
||||
@ -124,7 +125,7 @@ Public Class GlobixControls
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Sub Lookup_SelectedValuesChanged(sender As LookupControl2, SelectedValues As List(Of String))
|
||||
Private Sub Lookup_SelectedValuesChanged(sender As LookupControl3, SelectedValues As List(Of String))
|
||||
PrepareDependingControl(sender)
|
||||
End Sub
|
||||
|
||||
@ -476,9 +477,9 @@ Public Class GlobixControls
|
||||
DirectCast(oFoundControl, DevExpress.XtraEditors.TextEdit).Text = oValue
|
||||
End If
|
||||
End If
|
||||
Case GetType(LookupControl2).Name
|
||||
Case GetType(LookupControl3).Name
|
||||
_Logger.Debug("Setting Value for LookupControl [{0}]: [{1}]", oFoundControl.Name, "DATATABLE")
|
||||
DirectCast(oFoundControl, LookupControl2).DataSource = oDatatable
|
||||
DirectCast(oFoundControl, LookupControl3).Properties.DataSource = oDatatable
|
||||
Case GetType(ComboBox).Name
|
||||
_Logger.Debug("Setting Value for Combobox [{0}]: [{1}]", oFoundControl.Name, "DATATABLE")
|
||||
DirectCast(oFoundControl, ComboBox).DataSource = oDatatable
|
||||
|
||||
@ -216,22 +216,22 @@ Public Class GlobixPatterns
|
||||
_Logger.Error(ex)
|
||||
_Logger.Warn("Control Value for CheckBox [{0}] could not be retrieved!", oFoundControl.Name)
|
||||
End Try
|
||||
ElseIf TypeOf oFoundControl Is LookupControl2 Then
|
||||
ElseIf TypeOf oFoundControl Is LookupControl3 Then
|
||||
Try
|
||||
Dim oLookupControl = DirectCast(oFoundControl, LookupControl2)
|
||||
Dim oLookupControl = DirectCast(oFoundControl, LookupControl3)
|
||||
|
||||
If oLookupControl.MultiSelect Then
|
||||
If oLookupControl.Properties.MultiSelect Then
|
||||
Select Case oFoundType
|
||||
Case "INTEGER"
|
||||
oValue = String.Join(",", oLookupControl.SelectedValues)
|
||||
oValue = String.Join(",", oLookupControl.Properties.SelectedValues)
|
||||
Case "VARCHAR"
|
||||
Dim oWrapped = oLookupControl.SelectedValues
|
||||
Dim oWrapped = oLookupControl.Properties.SelectedValues
|
||||
oValue = String.Join(",", oWrapped)
|
||||
Case Else
|
||||
_Logger.Warn("Lookup Control with [{0}] is not supported!", oFoundType)
|
||||
End Select
|
||||
Else
|
||||
oValue = NotNull(oLookupControl.SelectedValues.Item(0), "")
|
||||
oValue = NotNull(oLookupControl.Properties.SelectedValues.Item(0), "")
|
||||
End If
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
|
||||
@ -574,9 +574,9 @@ Public Class frmGlobix_Index
|
||||
DirectCast(oFoundControl, DevExpress.XtraEditors.TextEdit).Text = oValue
|
||||
End If
|
||||
End If
|
||||
Case GetType(LookupControl2).Name
|
||||
Case GetType(LookupControl3).Name
|
||||
_Logger.Debug("Setting Value for LookupControl [{0}]: [{1}]", oFoundControl.Name, "DATATABLE")
|
||||
DirectCast(oFoundControl, LookupControl2).DataSource = oDatatable
|
||||
DirectCast(oFoundControl, LookupControl3).Properties.DataSource = oDatatable
|
||||
Case GetType(ComboBox).Name
|
||||
_Logger.Debug("Setting Value for Combobox [{0}]: [{1}]", oFoundControl.Name, "DATATABLE")
|
||||
DirectCast(oFoundControl, ComboBox).DataSource = oDatatable
|
||||
@ -587,7 +587,7 @@ Public Class frmGlobix_Index
|
||||
_Logger.Error(ex)
|
||||
End Try
|
||||
End Sub
|
||||
Private Function GetLookupData(pLookup As LookupControl2, pSQLCommand As String, pConnectionId As Integer)
|
||||
Private Function GetLookupData(pLookup As LookupControl3, pSQLCommand As String, pConnectionId As Integer)
|
||||
Dim oConnectionString = GetConnectionString(pConnectionId)
|
||||
|
||||
If oConnectionString IsNot Nothing And pSQLCommand.Length > 0 Then
|
||||
@ -1673,8 +1673,8 @@ Public Class frmGlobix_Index
|
||||
End If
|
||||
|
||||
If oControl.Name.StartsWith("cmbMulti") Then
|
||||
Dim oLookup = DirectCast(oControl, DigitalData.Controls.LookupGrid.LookupControl2)
|
||||
Dim values As List(Of String) = oLookup.SelectedValues
|
||||
Dim oLookup = DirectCast(oControl, LookupControl3)
|
||||
Dim values As List(Of String) = oLookup.Properties.SelectedValues
|
||||
|
||||
If values.Count = 0 Then
|
||||
Dim oIndexName = Replace(oLookup.Name, "cmbMulti", "")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user