Fix endless loop/crash after resetting layout
This commit is contained in:
parent
dc9ed0887d
commit
6e9b190f00
@ -64,6 +64,11 @@ Public Class RefreshHelper
|
|||||||
Private Function FindParentRowHandle(pRowInfo As RowInfo, oRowHandle As Integer) As Integer
|
Private Function FindParentRowHandle(pRowInfo As RowInfo, oRowHandle As Integer) As Integer
|
||||||
Dim oParentRowHandle As Integer = _View.GetParentRowHandle(oRowHandle)
|
Dim oParentRowHandle As Integer = _View.GetParentRowHandle(oRowHandle)
|
||||||
|
|
||||||
|
' Fixes endless loop when parent row handle is below zero
|
||||||
|
If oParentRowHandle < 0 Then
|
||||||
|
Return oParentRowHandle
|
||||||
|
End If
|
||||||
|
|
||||||
Do While _View.GetRowLevel(oParentRowHandle) <> pRowInfo.Level
|
Do While _View.GetRowLevel(oParentRowHandle) <> pRowInfo.Level
|
||||||
oParentRowHandle = _View.GetParentRowHandle(oParentRowHandle)
|
oParentRowHandle = _View.GetParentRowHandle(oParentRowHandle)
|
||||||
Loop
|
Loop
|
||||||
|
|||||||
@ -671,7 +671,9 @@ Public Class frmMain
|
|||||||
|
|
||||||
End Try
|
End Try
|
||||||
Try
|
Try
|
||||||
GridViewWFItems.Columns.Item("ROW_COLOR").Visible = False
|
If GridViewWFItems.Columns.ColumnByFieldName("ROW_COLOR") IsNot Nothing Then
|
||||||
|
GridViewWFItems.Columns.Item("ROW_COLOR").Visible = False
|
||||||
|
End If
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
|
|
||||||
End Try
|
End Try
|
||||||
@ -2072,9 +2074,7 @@ Public Class frmMain
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Async Function GridLayout_Reset() As Tasks.Task
|
||||||
|
|
||||||
Private Async Sub GridLayout_Reset()
|
|
||||||
FRONTEND_ACTION = "RESET_LAYOUT"
|
FRONTEND_ACTION = "RESET_LAYOUT"
|
||||||
Await Reset_GridLayout(False)
|
Await Reset_GridLayout(False)
|
||||||
Await Decide_Load(False, True)
|
Await Decide_Load(False, True)
|
||||||
@ -2082,7 +2082,8 @@ Public Class frmMain
|
|||||||
GridBuilder.WithFontSizeDelta(CONFIG.Config.GridFontSizeDelta)
|
GridBuilder.WithFontSizeDelta(CONFIG.Config.GridFontSizeDelta)
|
||||||
If GridControl_Docs.Visible = True And FormOpenClose = False Then RefreshHelper.LoadViewInfo()
|
If GridControl_Docs.Visible = True And FormOpenClose = False Then RefreshHelper.LoadViewInfo()
|
||||||
FRONTEND_ACTION = FA_NONE
|
FRONTEND_ACTION = FA_NONE
|
||||||
End Sub
|
End Function
|
||||||
|
|
||||||
Async Function Reset_GridLayout(FormLoad As Boolean) As Tasks.Task
|
Async Function Reset_GridLayout(FormLoad As Boolean) As Tasks.Task
|
||||||
|
|
||||||
If GridControl_Docs.Visible = True And FormOpenClose = False Then
|
If GridControl_Docs.Visible = True And FormOpenClose = False Then
|
||||||
@ -2875,9 +2876,9 @@ Public Class frmMain
|
|||||||
FRONTEND_ACTION = FA_NONE
|
FRONTEND_ACTION = FA_NONE
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub BarButtonItem3_ItemClick_2(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem3.ItemClick
|
Private Async Function BarButtonItem3_ItemClick_2(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) As Tasks.Task Handles BarButtonItem3.ItemClick
|
||||||
GridLayout_Reset()
|
Await GridLayout_Reset()
|
||||||
End Sub
|
End Function
|
||||||
|
|
||||||
Private Sub BarButtonItem5_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItemExportExcel.ItemClick
|
Private Sub BarButtonItem5_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItemExportExcel.ItemClick
|
||||||
Grid_Export()
|
Grid_Export()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user