From 11d27cd860d623d9f179a1621d8d55b1e4ecb1eb Mon Sep 17 00:00:00 2001 From: Developer01 Date: Fri, 30 Jan 2026 13:02:55 +0100 Subject: [PATCH] Create_Basic_View --- app/TaskFlow/frmMain.vb | 106 ++++++++++++---------------------------- 1 file changed, 30 insertions(+), 76 deletions(-) diff --git a/app/TaskFlow/frmMain.vb b/app/TaskFlow/frmMain.vb index 95d49d0..48a9e68 100644 --- a/app/TaskFlow/frmMain.vb +++ b/app/TaskFlow/frmMain.vb @@ -1040,8 +1040,19 @@ Public Class frmMain End Try End Function Sub Create_Basic_View() + Dim gridUpdateStarted As Boolean = False + Dim viewUpdateStarted As Boolean = False + Try FRONTEND_ACTION = "Create_Basic_View" + + If GridControlWorkflows.Visible Then + GridControlWorkflows.BeginUpdate() + gridUpdateStarted = True + GridViewWorkflows.BeginUpdate() + viewUpdateStarted = True + End If + GridControlWorkflows.DataSource = Nothing Try GridViewWorkflows.Columns.Clear() @@ -1049,20 +1060,20 @@ Public Class frmMain LOGGER.Error(ex) LOGGER.Warn("Could not clear GridViewWorkflows.Columns") End Try - If TL_ICON = True Then - ' Spalte für Status Icon erstellen - Dim columnStateIcon As New DataColumn() - columnStateIcon.DataType = GetType(Image) - columnStateIcon.ColumnName = "ICON" - columnStateIcon.Caption = "" + + If TL_ICON = True AndAlso DT_CURR_WF_ITEMS IsNot Nothing AndAlso DT_CURR_WF_ITEMS.Columns.Contains("ICON") = False Then + Dim columnStateIcon As New DataColumn() With { + .DataType = GetType(Image), + .ColumnName = "ICON", + .Caption = "" + } DT_CURR_WF_ITEMS.Columns.Add(columnStateIcon) End If - RedDocuments = 0 YellowDocuments = 0 GreenDocuments = 0 - If TL_ICON = True Then + If TL_ICON = True AndAlso DT_CURR_WF_ITEMS IsNot Nothing Then For Each row As DataRow In DT_CURR_WF_ITEMS.Rows Dim State As Integer = row.Item("TL_STATE") Select Case State @@ -1079,94 +1090,31 @@ Public Class frmMain Next End If - 'If IDB_ACTIVE = True Then - ' ' Spalte für Conversation erstellen - ' Dim columnConvIcon As New DataColumn() - ' columnConvIcon.DataType = GetType(Image) - ' columnConvIcon.ColumnName = "CONVERSATION" - ' columnConvIcon.Caption = "" - ' DT_CURR_WF_ITEMS.Columns.Add(columnConvIcon) - 'End If - 'For Each oRow As DataRow In DT_CURR_WF_ITEMS.Rows - ' Try - ' Dim oCONVYN As Boolean - ' Try - ' oCONVYN = oRow.Item("CONV_YN") - ' Catch ex As Exception - ' LOGGER.Warn($"Please check Your select/view Config - Column CONV_YN is missing [{ex.Message}]") - ' Exit For - ' End Try - - ' Select Case oCONVYN - ' Case True - ' oRow.Item("CONVERSATION") = My.Resources.conversation - ' End Select - ' Catch ex As Exception - ' LOGGER.Warn("Create_Basic_View1 - Column CONVERSATION obviously is not part of GridViewWorkflows") - ' End Try - - 'Next bindsourcegrid.DataSource = DT_CURR_WF_ITEMS GridControlWorkflows.DataSource = bindsourcegrid - Dim objectCount_Descr = GridViewWorkflows.RowCount.ToString - - 'Dim ocapt = ClassAllgemeineFunktionen.GUI_LANGUAGE_INFO("DescItems") - - Dim ocapt = String.Format(S._0__Vorgänge, objectCount_Descr) - objectCount_Descr = $"{objectCount_Descr} {ocapt}" - - 'tslblObjectCount.Text = objectCount_Descr - - 'GridControlDocRow.ForceInitialize() RestoreLayout() - COLUMNS_INVISIBLE() Try - If TL_ICON = True Then + If TL_ICON = True AndAlso GridViewWorkflows.Columns.Count > 0 Then GridViewWorkflows.Columns.Item("ICON").MaxWidth = 24 GridViewWorkflows.Columns.Item("ICON").MinWidth = 24 GridViewWorkflows.Columns.Item("ICON").AppearanceCell.BackColor = Color.White GridViewWorkflows.Columns.Item("ICON").Fixed = FixedStyle.Left End If Catch ex As Exception - End Try - - - 'If IDB_ACTIVE = True Then - ' Try - ' GridViewWorkflows.Columns.Item("CONVERSATION").MaxWidth = 24 - ' GridViewWorkflows.Columns.Item("CONVERSATION").MinWidth = 24 - ' GridViewWorkflows.Columns.Item("CONVERSATION").Fixed = FixedStyle.Left - ' Catch ex As Exception - ' LOGGER.Info("Create_Basic_View2 - Column CONVERSATION obviously is not part of GridViewWorkflows - Trying to Rest Layout") - ' ResetLayout() - ' FRONTEND_ACTION = FA_NONE - ' Exit Sub - ' End Try - 'End If - - - ' GridViewWorkflows.OptionsView.ShowIndicator = False Try - Dim oReducedColName = LAST_EDITED_COLUMN.Replace("[", "") - oReducedColName = oReducedColName.Replace("]", "") - 'GridViewWorkflows.Columns(oReducedColName).DisplayFormat.FormatType = FormatType.DateTime - 'GridViewWorkflows.Columns(oReducedColName).DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss" + Dim oReducedColName = LAST_EDITED_COLUMN.Replace("[", "").Replace("]", "") Catch ex As Exception Try - 'GridViewWorkflows.Columns("Zuletzt bearbeitet").DisplayFormat.FormatType = FormatType.DateTime - 'GridViewWorkflows.Columns("Zuletzt bearbeitet").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss" Catch ex1 As Exception LOGGER.Warn("(CreateBasicView)Column [Last edited] or [Zuletzt bearbeitet] not part of OverviewSQL") End Try - End Try - LOGGER.Debug("All columns in CreateBasicView created") Try GridViewWorkflows.Columns.Item("GROUP_TEXT").Visible = False GridViewWorkflows.Columns.Item("GROUP_COLOR").Visible = False @@ -1174,13 +1122,19 @@ Public Class frmMain If OverviewOrDEtail = "OVERVIEW" Then LOGGER.Warn("ATTENTION: GROUP COLUMNS NOT PART OF GRID") End If - End Try - LOGGER.Debug("All columns in CreateBasicView created") + Catch ex As Exception LOGGER.Error(ex) + Finally + If viewUpdateStarted Then + GridViewWorkflows.EndUpdate() + End If + If gridUpdateStarted Then + GridControlWorkflows.EndUpdate() + End If + FRONTEND_ACTION = FA_NONE End Try - FRONTEND_ACTION = FA_NONE End Sub Private Function GridLayoutChanged() As Boolean Try