From fa22fba42098824f0e076b68677e92294b17020b Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Fri, 19 Aug 2022 11:48:43 +0200 Subject: [PATCH] attempt to fix weird third row focus jump --- app/DD_PM_WINDREAM/ClassControlCreator.vb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/app/DD_PM_WINDREAM/ClassControlCreator.vb b/app/DD_PM_WINDREAM/ClassControlCreator.vb index aa6a019..b5fda7f 100644 --- a/app/DD_PM_WINDREAM/ClassControlCreator.vb +++ b/app/DD_PM_WINDREAM/ClassControlCreator.vb @@ -581,8 +581,9 @@ Public Class ClassControlCreator Catch ex As Exception End Try - End If + + Dim oShouldDisplayFooter As Boolean = False For Each oCol As GridColumn In oView.Columns @@ -701,7 +702,15 @@ Public Class ClassControlCreator AddHandler oView.ValidateRow, AddressOf View_ValidateRow AddHandler oControl.LostFocus, Sub(sender As GridControl, e As EventArgs) Dim oView2 As GridView = sender.FocusedView - oView2.UpdateCurrentRow() + + ' 19.08.2022: + ' Calling UpdateCurrentRow when newRowModified Is true + ' leads to some weird jumping of focus in the current cell. + ' This seems to fix it. + If newRowModified = False Then + oView2.UpdateCurrentRow() + End If + End Sub ' 08.11.2021: Fix editor being empty on first open @@ -1039,7 +1048,7 @@ Public Class ClassControlCreator Logger.Error(ex) End Try - If oIsRequired And pValue.ToString = "" Then + If oIsRequired And (pValue IsNot Nothing AndAlso pValue.ToString = "") Then pErrorText = "Spalte muss ausgefüllt werden!" pIsValid = False Return False