Merge branch 'master' into Feature_LookupGrid_DependingControls

This commit is contained in:
Jonathan Jenne
2021-10-04 13:27:20 +02:00
8 changed files with 292 additions and 226 deletions

View File

@@ -1,4 +1,5 @@
Imports System.ComponentModel
Imports System.Text.RegularExpressions
Imports DD_LIB_Standards
Imports DevExpress.Utils
Imports DevExpress.XtraEditors
@@ -428,6 +429,11 @@ Public Class ClassControlCreator
oControl.UseEmbeddedNavigator = Not row.Item("READ_ONLY")
' Copy single cell value in CTRL+C instead of whole row
oView.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CellSelect
oView.OptionsSelection.MultiSelect = True
oView.OptionsClipboard.CopyColumnHeaders = DefaultBoolean.False
If row.Item("VKT_ADD_ITEM") = True Then
oView.OptionsBehavior.AllowAddRows = DefaultBoolean.True
oView.OptionsBehavior.AllowDeleteRows = DefaultBoolean.True
@@ -546,10 +552,30 @@ Public Class ClassControlCreator
Dim oIsRequired = oColumn.Item("VALIDATION")
Dim oValue = NotNull(oView.GetRowCellValue(e.RowHandle, oCol.ColumnName), "")
Try
Dim oRegex = NotNull(oColumn.Item("REGEX_MATCH"), String.Empty)
Dim oRegexMessage = NotNull(oColumn.Item("REGEX_MESSAGE_DE"), String.Empty)
If oRegex <> String.Empty Then
Dim oMatch = New Regex(oRegex).IsMatch(oValue)
Dim oDefaultMessage = "Wert entspricht nicht dem gefordertem Format!"
Dim oMessage = IIf(oRegexMessage <> String.Empty, oRegexMessage, oDefaultMessage)
If oMatch = False Then
oView.SetColumnError(oGridColumn, oMessage)
e.Valid = False
Exit For
End If
End If
Catch ex As Exception
LOGGER.Error(ex)
End Try
If oIsRequired And oValue = "" Then
oView.SetColumnError(oGridColumn, "Spalte muss ausgefüllt werden!")
e.Valid = False
Exit For
End If
Next
End Sub