Fix profile changing when refreshing, fix crash when clicking on "new x" twice in a row

This commit is contained in:
Jonathan Jenne
2021-09-22 13:50:08 +02:00
parent 9c0c31e141
commit a97c3b8f41
4 changed files with 93 additions and 71 deletions

View File

@@ -106,7 +106,7 @@ Public Class frmAdministration
Me.TBDD_DOKUMENTARTTableAdapter.FillByModuleGI(Me.MyDataset.TBDD_DOKUMENTART)
If MyDataset.TBDD_DOKUMENTART.Rows.Count > 0 Then
GridView1.SelectRow(1)
GridViewProfile.SelectRow(1)
EnableControls(XtraTabPageProfiles)
End If
If Me.DOKART_GUIDTextBox.Text <> "" Then
@@ -757,7 +757,9 @@ Public Class frmAdministration
End Sub
Sub LoadGlobix_Doctypes()
Dim oFocusedRow = GridViewProfile.FocusedRowHandle
Load_Dokart()
GridViewProfile.FocusedRowHandle = oFocusedRow
End Sub
Private Sub btncrFolder_delete_Click(sender As Object, e As EventArgs) Handles btncrFolder_delete.Click
@@ -1069,11 +1071,15 @@ Public Class frmAdministration
End Sub
Private Sub BarButtonItem16_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem16.ItemClick
TBDD_INDEX_MANBindingSource.AddNew()
Try
TBDD_INDEX_MANBindingSource.AddNew()
If WINDREAM_DIRECTCheckBox.Checked = True Then
load_WDIndices()
End If
If WINDREAM_DIRECTCheckBox.Checked = True Then
load_WDIndices()
End If
Catch ex As Exception
LOGGER.Error(ex)
End Try
End Sub
Private Sub BarButtonItem17_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem17.ItemClick
@@ -1108,12 +1114,18 @@ Public Class frmAdministration
Private Sub BarButtonItem18_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem18.ItemClick
If DOKART_GUIDTextBox.Text <> String.Empty Then
Dim oSelectedIndex = ListBoxControl3.SelectedIndex
Load_INDEXMAN(DOKART_GUIDTextBox.Text)
ListBoxControl3.SelectedIndex = oSelectedIndex
End If
End Sub
Private Sub BarButtonItem20_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem20.ItemClick
TBDD_INDEX_MAN_POSTPROCESSINGBindingSource.AddNew()
Try
TBDD_INDEX_MAN_POSTPROCESSINGBindingSource.AddNew()
Catch ex As Exception
LOGGER.Error(ex)
End Try
End Sub
Private Sub BarButtonItem21_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem21.ItemClick
@@ -1144,15 +1156,21 @@ Public Class frmAdministration
End Sub
Private Sub BarButtonItem22_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem22.ItemClick
Dim oSelectedIndex = ListBox1.SelectedIndex
Load_PostProcessing(Me.DOKART_GUIDTextBox.Text)
ListBox1.SelectedIndex = oSelectedIndex
End Sub
Private Sub BarButtonItem24_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem24.ItemClick
TBDD_INDEX_AUTOMBindingSource.AddNew()
Try
TBDD_INDEX_AUTOMBindingSource.AddNew()
If WINDREAM_DIRECTCheckBox.Checked = True Then
load_WDIndices()
End If
If WINDREAM_DIRECTCheckBox.Checked = True Then
load_WDIndices()
End If
Catch ex As Exception
LOGGER.Error(ex)
End Try
End Sub
Private Sub ToolStripButton17_Click(sender As Object, e As EventArgs)
@@ -1181,7 +1199,9 @@ Public Class frmAdministration
End Sub
Private Sub BarButtonItem26_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem26.ItemClick
Dim oSelectedIndex = ListBoxControl4.SelectedIndex
Load_INDEXE_AUTO(Me.DOKART_GUIDTextBox.Text)
ListBoxControl4.SelectedIndex = oSelectedIndex
End Sub
Private Sub BarButtonItem25_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem25.ItemClick
@@ -1228,17 +1248,19 @@ Public Class frmAdministration
End Sub
Private Sub BarButtonItem28_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem28.ItemClick
TBGI_REGEX_DOCTYPEBindingSource.AddNew()
EnableControls(XtraTabPageProfileRegex)
Try
TBGI_REGEX_DOCTYPEBindingSource.AddNew()
EnableControls(XtraTabPageProfileRegex)
Catch ex As Exception
LOGGER.Error(ex)
End Try
End Sub
Private Sub GridView1_ValidateRow(sender As Object, e As ValidateRowEventArgs) Handles GridView1.ValidateRow
Private Sub GridView1_ValidateRow(sender As Object, e As ValidateRowEventArgs) Handles GridViewProfile.ValidateRow
e.Valid = True
End Sub
Private Sub GridView1_InvalidRowException(sender As Object, e As InvalidRowExceptionEventArgs) Handles GridView1.InvalidRowException
Private Sub GridView1_InvalidRowException(sender As Object, e As InvalidRowExceptionEventArgs) Handles GridViewProfile.InvalidRowException
e.ExceptionMode = DevExpress.XtraEditors.Controls.ExceptionMode.NoAction
End Sub
@@ -1316,8 +1338,8 @@ Public Class frmAdministration
End If
End Sub
Private Sub GridView1_BeforeLeaveRow(sender As Object, e As RowAllowEventArgs) Handles GridView1.BeforeLeaveRow
Dim oRowView As DataRowView = GridView1.GetRow(e.RowHandle)
Private Sub GridView1_BeforeLeaveRow(sender As Object, e As RowAllowEventArgs) Handles GridViewProfile.BeforeLeaveRow
Dim oRowView As DataRowView = GridViewProfile.GetRow(e.RowHandle)
Dim oProfileName As String = oRowView?.Row.Item("BEZEICHNUNG")
If oRowView Is Nothing Then