add depending controls for lookupgrid

This commit is contained in:
Jonathan Jenne
2020-02-11 14:44:25 +01:00
parent acf61c9ca5
commit b4e410291a
6 changed files with 2769 additions and 487 deletions

View File

@@ -8,6 +8,8 @@ Public Class ClassControls
Public Class ControlMeta
Public Property IndexName As String
Public Property IndexType As String
Public Property MultipleValues As Boolean = False
End Class
Public Sub New(Panel As Panel, Form As frmIndex)
@@ -23,7 +25,8 @@ Public Class ClassControls
chk.Size = New Size(100, 27)
chk.Location = New Point(11, y)
chk.Tag = New ControlMeta() With {
.IndexName = indexname
.IndexName = indexname,
.IndexType = "BOOLEAN"
}
If caption <> "" Then
@@ -54,7 +57,7 @@ Public Class ClassControls
PrepareDependingControl(sender)
End Sub
Public Function AddVorschlag_ComboBox(indexname As String, y As Integer, conid As Integer, sql_Vorschlag As String, Multiselect As Boolean, Optional Vorgabe As String = "", Optional AddNewValues As Boolean = False, Optional PreventDuplicateValues As Boolean = False) As Control
Public Function AddVorschlag_ComboBox(indexname As String, y As Integer, conid As Integer, sql_Vorschlag As String, Multiselect As Boolean, DataType As String, Optional Vorgabe As String = "", Optional AddNewValues As Boolean = False, Optional PreventDuplicateValues As Boolean = False) As Control
Try
Dim oSql As String = sql_Vorschlag
Dim oConnectionString As String
@@ -66,11 +69,12 @@ Public Class ClassControls
.Size = New Size(300, 27),
.Name = "cmbMulti" & indexname,
.Tag = New ControlMeta() With {
.IndexName = indexname
.IndexName = indexname,
.IndexType = DataType
}
}
AddHandler oControl.
AddHandler oControl.SelectedValuesChanged, AddressOf Lookup_SelectedValuesChanged
oConnectionString = ClassFormFunctions.GetConnectionString(conid)
If oConnectionString IsNot Nothing Then
@@ -90,6 +94,10 @@ Public Class ClassControls
End Try
End Function
Private Sub Lookup_SelectedValuesChanged(sender As LookupControl2, SelectedValues As List(Of String))
PrepareDependingControl(sender)
End Sub
Function AddCombobox(indexname As String, y As Integer)
Dim cmb As New ComboBox
cmb.Name = "cmb" & indexname
@@ -251,31 +259,26 @@ Public Class ClassControls
Catch ex As Exception
End Try
End If
End If
End If
Next
End If
Catch ex As Exception
ClassLogger.Add(" - Unvorhergesehener Unexpected error in Renew_ComboboxResults - Fehler: " & vbNewLine & ex.Message)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Unvorhergesehener Unexpected error in Renew_ComboboxResults:")
End Try
End Sub
Public Function AddTextBox(indexname As String, y As Integer, text As String) As TextBox
Public Function AddTextBox(indexname As String, y As Integer, text As String, DataType As String) As TextBox
Dim txt As New TextBox
txt.Name = "txt" & indexname
txt.Size = New Size(260, 27)
txt.Location = New Point(11, y)
txt.Tag = New ControlMeta() With {
.IndexName = indexname
.IndexName = indexname,
.IndexType = DataType
}
If text <> "" Then