jj 08.06 gridviewcheckable
This commit is contained in:
@@ -444,6 +444,10 @@ Public Class ClassControlValues
|
||||
Dim chlistbox = DirectCast(Ctrl, DevExpress.XtraEditors.CheckedListBoxControl)
|
||||
ControlLoader.CheckedListBox.LoadList(chlistbox, FormId, connID, sqlcommand)
|
||||
|
||||
Case GetType(DevExpress.XtraGrid.GridControl)
|
||||
Dim gridControl = DirectCast(Ctrl, DevExpress.XtraGrid.GridControl)
|
||||
ControlLoader.DataGridViewCheckable.LoadList(gridControl, FormId, connID, sqlcommand)
|
||||
|
||||
End Select
|
||||
|
||||
PerfomanceHelper.ResumeDraw(Ctrl)
|
||||
@@ -460,7 +464,8 @@ Public Class ClassControlValues
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Sucht alle Controls in der aktuellen Entität, die eine Abhängigkeit besitzen
|
||||
''' Sucht alle Controls in der aktuellen Entität, die eine Abhängigkeit besitzen,
|
||||
''' und (de)aktiviert sie basierend auf dem Wert er Abhängigkeit
|
||||
''' </summary>
|
||||
''' <remarks></remarks>
|
||||
Public Shared Sub Enable_Depending_Controls(FormId As Integer, RecordId As Integer, ParentRecordId As Integer, controls As Control.ControlCollection, entity_ID As Integer)
|
||||
@@ -523,42 +528,13 @@ Public Class ClassControlValues
|
||||
DependingControlSQL = regex.Replace(DependingControlSQL, value)
|
||||
|
||||
Dim enableDT As DataTable = ClassDatabase.Return_Datatable(DependingControlSQL)
|
||||
Dim type = DependingControl.GetType().Name
|
||||
|
||||
' Jetzt wird basierend auf dem Ergebnis das DependingControl aktiviert/deaktiviert
|
||||
Select Case type
|
||||
Case "DateEdit"
|
||||
Try
|
||||
Dim enabled As Boolean = CBool(enableDT.Rows(0).Item(0))
|
||||
DependingControl.Enabled = enabled
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpected Error in EnableControls - DateEdit: " & ex.Message, True)
|
||||
End Try
|
||||
Case "CustomComboBox"
|
||||
Try
|
||||
Dim enabled As Boolean = CBool(enableDT.Rows(0).Item(0))
|
||||
DependingControl.Enabled = enabled
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpected Error in EnableControls - CustomComboBox: " & ex.Message, True)
|
||||
End Try
|
||||
Case "TextBox"
|
||||
Try
|
||||
Dim enabled As Boolean = CBool(enableDT.Rows(0).Item(0))
|
||||
DependingControl.Enabled = enabled
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpected Error in EnableControls - TextBox: " & ex.Message, True)
|
||||
End Try
|
||||
Case "CheckBox"
|
||||
Try
|
||||
Dim enabled As Boolean = CBool(enableDT.Rows(0).Item(0))
|
||||
DependingControl.Enabled = enabled
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpected Error in EnableControls - Checkbox: " & ex.Message, True)
|
||||
End Try
|
||||
|
||||
End Select
|
||||
|
||||
|
||||
If dt.Rows.Count = 1 Then
|
||||
Dim enabled As Boolean = CBool(dt.Rows(0).Item(0))
|
||||
DependingControl.Enabled = enabled
|
||||
Else
|
||||
ClassLogger.Add(" >> Attention: RowCount for enabling control was '" & dt.Rows.Count.ToString & "' and not 1 as expected - Check SQL: '" & DependingControlSQL & "'")
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
|
||||
Reference in New Issue
Block a user