fix a fucking idiot snappanel
This commit is contained in:
@@ -489,12 +489,19 @@ Public Class ClassControlCreator
|
||||
|
||||
Next
|
||||
|
||||
|
||||
oView.PopulateColumns()
|
||||
oView.PopulateColumns(oDatatable)
|
||||
oControl.DataSource = oDatatable
|
||||
oControl.RefreshDataSource()
|
||||
oControl.ForceInitialize()
|
||||
|
||||
For Each oCol As GridColumn In oView.Columns
|
||||
Dim oColumnData As DataRow = DT_MY_COLUMNS.Select($"SPALTENNAME = '{oCol.FieldName}'").FirstOrDefault()
|
||||
If oColumnData Is Nothing Then
|
||||
Dim oSequence As Integer = oColumnData.Item("SEQUENCE")
|
||||
oCol.VisibleIndex = oSequence
|
||||
End If
|
||||
Next
|
||||
|
||||
AddHandler oView.CustomRowCellEdit, Sub(sender As Object, e As CustomRowCellEditEventArgs)
|
||||
For Each oRow As DataRow In DT_MY_COLUMNS.Rows
|
||||
If oRow.Item("SPALTENNAME") = e.Column.FieldName Then
|
||||
@@ -540,37 +547,37 @@ Public Class ClassControlCreator
|
||||
Next
|
||||
End Sub
|
||||
|
||||
AddHandler oView.CellValueChanged, Sub(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs)
|
||||
Console.WriteLine("")
|
||||
End Sub
|
||||
'AddHandler oView.CellValueChanged, Sub(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs)
|
||||
' Console.WriteLine("")
|
||||
' End Sub
|
||||
|
||||
AddHandler oView.ValidateRow, Sub(sender As Object, e As ValidateRowEventArgs)
|
||||
Console.WriteLine("")
|
||||
End Sub
|
||||
'AddHandler oView.ValidateRow, Sub(sender As Object, e As ValidateRowEventArgs)
|
||||
' Console.WriteLine("")
|
||||
' End Sub
|
||||
|
||||
AddHandler oView.ValidatingEditor, Sub(sender As Object, e As BaseContainerValidateEditorEventArgs)
|
||||
Dim oRow As DataRowView = oView.GetRow(oView.FocusedRowHandle)
|
||||
'AddHandler oView.ValidatingEditor, Sub(sender As Object, e As BaseContainerValidateEditorEventArgs)
|
||||
' Dim oRow As DataRowView = oView.GetRow(oView.FocusedRowHandle)
|
||||
|
||||
For Each oCol As DataColumn In oRow.DataView.Table.Columns
|
||||
Dim oColumn As DataRow = (From r As DataRow In DT_MY_COLUMNS.Rows
|
||||
Where r.Item("SPALTENNAME") = oCol.ColumnName
|
||||
Select r).FirstOrDefault()
|
||||
' For Each oCol As DataColumn In oRow.DataView.Table.Columns
|
||||
' Dim oColumn As DataRow = (From r As DataRow In DT_MY_COLUMNS.Rows
|
||||
' Where r.Item("SPALTENNAME") = oCol.ColumnName
|
||||
' Select r).FirstOrDefault()
|
||||
|
||||
Dim oIsRequired = oColumn.Item("VALIDATION")
|
||||
Dim oValue As String = NotNull(e.Value, "")
|
||||
' Dim oIsRequired = oColumn.Item("VALIDATION")
|
||||
' Dim oValue As String = NotNull(e.Value, "")
|
||||
|
||||
If oValue.contains(" | ") Then
|
||||
oValue = oValue.Split(" | ").ToList().First()
|
||||
e.Value = oValue
|
||||
End If
|
||||
' If oValue.contains(" | ") Then
|
||||
' oValue = oValue.Split(" | ").ToList().First()
|
||||
' e.Value = oValue
|
||||
' End If
|
||||
|
||||
If oIsRequired And oValue = "" Then
|
||||
e.Valid = False
|
||||
e.ErrorText = $"Spalte {oColumn.Item("SPALTEN_HEADER")} muss ausgefüllt werden!"
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
' If oIsRequired And oValue = "" Then
|
||||
' e.Valid = False
|
||||
' e.ErrorText = $"Spalte {oColumn.Item("SPALTEN_HEADER")} muss ausgefüllt werden!"
|
||||
' Exit For
|
||||
' End If
|
||||
' Next
|
||||
' End Sub
|
||||
|
||||
Return oControl
|
||||
End Function
|
||||
|
||||
Reference in New Issue
Block a user