improve validation, switch to inline error marker again
This commit is contained in:
@@ -409,7 +409,7 @@ Public Class ClassControlCreator
|
||||
Public Shared Function CreateExistingGridControl(row As DataRow, DT_MY_COLUMNS As DataTable, designMode As Boolean) As GridControl
|
||||
Dim oControl As GridControl = CreateBaseControl(New GridControl(), row, designMode)
|
||||
Dim oDatatable As New DataTable
|
||||
Dim oView As DevExpress.XtraGrid.Views.Grid.GridView
|
||||
Dim oView As GridView
|
||||
|
||||
oControl.ForceInitialize()
|
||||
|
||||
@@ -555,19 +555,23 @@ Public Class ClassControlCreator
|
||||
Where r.Item("SPALTENNAME") = oCol.ColumnName
|
||||
Select r).FirstOrDefault()
|
||||
|
||||
Dim oGridColumn As GridColumn = (From c As GridColumn In oView.Columns
|
||||
Where c.FieldName = oCol.ColumnName
|
||||
Select c).FirstOrDefault()
|
||||
|
||||
Dim oIsRequired = oColumn.Item("VALIDATION")
|
||||
Dim oValue = NotNull(oView.GetRowCellValue(e.RowHandle, oCol.ColumnName), "")
|
||||
|
||||
If oIsRequired And oValue = "" Then
|
||||
oView.SetColumnError(oGridColumn, "Spalte muss ausgefüllt werden!")
|
||||
e.Valid = False
|
||||
e.ErrorText = $"Spalte {oColumn.Item("SPALTEN_HEADER")} muss ausgefüllt werden!"
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
AddHandler oView.InvalidRowException, Sub(sender As Object, e As InvalidRowExceptionEventArgs)
|
||||
e.ExceptionMode = ExceptionMode.DisplayError
|
||||
e.ExceptionMode = ExceptionMode.NoAction
|
||||
End Sub
|
||||
|
||||
AddHandler oView.ValidatingEditor, Sub(sender As Object, e As BaseContainerValidateEditorEventArgs)
|
||||
|
||||
Reference in New Issue
Block a user