Zooflow
This commit is contained in:
@@ -188,9 +188,7 @@ Public Class frmDocumentResultList
|
||||
SwitchDetailContainerHorizontal.Visibility = BarItemVisibility.Never
|
||||
End If
|
||||
|
||||
GridBuilder.
|
||||
WithDefaults().
|
||||
WithReadOnlyOptions()
|
||||
GridBuilder.WithReadOnlyOptions()
|
||||
|
||||
AddHandler GridView1.FocusedRowChanged, AddressOf GridView_FocusedRowChanged
|
||||
AddHandler GridView2.FocusedRowChanged, AddressOf GridView_FocusedRowChanged
|
||||
@@ -277,6 +275,10 @@ Public Class frmDocumentResultList
|
||||
|
||||
'Await ControlManager.LoadControlsForAttributes(oObjectId, oAttributes, RootMetadata)
|
||||
End If
|
||||
|
||||
RibbonPageCategoryFile.Visible = True
|
||||
Else
|
||||
RibbonPageCategoryFile.Visible = False
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ErrorHandler.ShowErrorMessage(ex, "GridView_FocusedRowChanged")
|
||||
@@ -285,6 +287,8 @@ Public Class frmDocumentResultList
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
#Region "Watcher"
|
||||
|
||||
Public Async Sub Watcher_FileOpened(sender As Object, e As DocumentResultList.Watcher.FileOpenedArgs) Handles Watcher.FileOpened
|
||||
Await _IDBClient.SetObjectStateAsync(e.File.Document.Id, OBJECT_STATE_FILE_OPENED, New Options.SetObjectStateOptions With {
|
||||
.Language = Environment.User.Language,
|
||||
@@ -389,6 +393,8 @@ Public Class frmDocumentResultList
|
||||
|
||||
End Select
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
Private Function InitAppServer() As Boolean
|
||||
@@ -466,8 +472,6 @@ Public Class frmDocumentResultList
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub UpdateGridData()
|
||||
' Load Grids
|
||||
For oIndex = 0 To ResultLists.Count - 1
|
||||
@@ -559,8 +563,8 @@ Public Class frmDocumentResultList
|
||||
|
||||
Private Sub CreateDocumentGrid(GridView As BandedGridView, Result As DocumentResultList.DocumentResult)
|
||||
Try
|
||||
If IsNothing(GridView.Columns("ICON")) Then
|
||||
Dim oIconColumn = GridView.Columns.AddVisible("ICON", "ICON")
|
||||
If IsNothing(GridView.Columns(COLUMN_ICON)) Then
|
||||
Dim oIconColumn = GridView.Columns.AddVisible(COLUMN_ICON, COLUMN_ICON)
|
||||
With oIconColumn
|
||||
.OptionsColumn.AllowSort = False
|
||||
.OptionsColumn.AllowSize = False
|
||||
@@ -585,38 +589,46 @@ Public Class frmDocumentResultList
|
||||
oChanged = "Changed"
|
||||
End If
|
||||
|
||||
Try
|
||||
Dim oDocIdColumn As GridColumn = GridView.Columns(COLUMN_DOCID)
|
||||
If Not IsNothing(oDocIdColumn) Then
|
||||
oDocIdColumn.Visible = False
|
||||
End If
|
||||
Dim oColumnsToHide As New List(Of String) From {
|
||||
oCreated, oChanged, COLUMN_DOCID, COLUMN_FILEPATH,
|
||||
"CREATED_WHEN", "CREATED_WHO", "ADDED_WHEN", "ADDED_WHO"
|
||||
}
|
||||
|
||||
For Each oFieldName As String In oColumnsToHide
|
||||
Try
|
||||
Dim oColumn = GridView.Columns(oFieldName)
|
||||
If oColumn IsNot Nothing Then
|
||||
oColumn.Visible = False
|
||||
End If
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
Next
|
||||
|
||||
Try
|
||||
Dim oFilePathColumn As GridColumn = GridView.Columns(COLUMN_FILEPATH)
|
||||
If Not IsNothing(oFilePathColumn) Then
|
||||
oFilePathColumn.Visible = False
|
||||
|
||||
' Hide Fullpath column completely in AppServer-Mode
|
||||
If OperationMode = OperationMode.WithAppServer Then
|
||||
oFilePathColumn.OptionsColumn.ShowInCustomizationForm = False
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim oCreatedColumn = GridView.Columns(oCreated)
|
||||
If Not IsNothing(oCreatedColumn) Then
|
||||
oCreatedColumn.DisplayFormat.FormatType = FormatType.DateTime
|
||||
oCreatedColumn.DisplayFormat.FormatString = Environment.User.DateFormat & " HH:MM:ss"
|
||||
End If
|
||||
'Dim oCreatedColumn = GridView.Columns(oCreated)
|
||||
'If Not IsNothing(oCreatedColumn) Then
|
||||
' oCreatedColumn.DisplayFormat.FormatType = FormatType.DateTime
|
||||
' oCreatedColumn.DisplayFormat.FormatString = Environment.User.DateFormat & " HH:MM:ss"
|
||||
'End If
|
||||
|
||||
Dim oChangedColumn = GridView.Columns(oChanged)
|
||||
If Not IsNothing(oChangedColumn) Then
|
||||
oChangedColumn.DisplayFormat.FormatType = FormatType.DateTime
|
||||
oChangedColumn.DisplayFormat.FormatString = Environment.User.DateFormat & " HH:MM:ss"
|
||||
End If
|
||||
'Dim oChangedColumn = GridView.Columns(oChanged)
|
||||
'If Not IsNothing(oChangedColumn) Then
|
||||
' oChangedColumn.DisplayFormat.FormatType = FormatType.DateTime
|
||||
' oChangedColumn.DisplayFormat.FormatString = Environment.User.DateFormat & " HH:MM:ss"
|
||||
'End If
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
|
||||
GridView.OptionsView.BestFitMaxRowCount = 30
|
||||
GridView.OptionsView.BestFitMaxRowCount = 10
|
||||
GridView.BestFitColumns()
|
||||
Catch ex As ApplicationException
|
||||
MsgBox($"Error while loading grid data for search {Result.Title}: {vbNewLine}{vbNewLine}{ex.Message}", MsgBoxStyle.Critical, Text)
|
||||
@@ -626,29 +638,41 @@ Public Class frmDocumentResultList
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
'Private Sub GridView1_CustomDrawCell(sender As Object, e As RowCellCustomDrawEventArgs) Handles GridView1.CustomDrawCell
|
||||
' Try
|
||||
' If e.RowHandle < 0 Then
|
||||
' Exit Sub
|
||||
' End If
|
||||
|
||||
' e.DefaultDraw()
|
||||
|
||||
' Dim oView As GridView = TryCast(sender, GridView)
|
||||
' Dim oCellInfo As GridCellInfo = TryCast(e.Cell, GridCellInfo)
|
||||
' Dim oRow As DataRow = oView.GetDataRow(e.RowHandle)
|
||||
' If e.RowHandle <> GridControl.NewItemRowHandle AndAlso e.Column.FieldName = COLUMN_ICON Then
|
||||
' Dim oRow As DataRow = TryCast(sender, GridView)?.GetDataRow(e.RowHandle)
|
||||
' Dim oValue = oRow.Item(COLUMN_FILENAME)
|
||||
|
||||
' If e.Column.FieldName = COLUMN_ICON Then
|
||||
' Dim oIcon = Helpers.GetIconByExtension(oValue)
|
||||
' Dim offsetX = 0
|
||||
' Dim offsetY = 0
|
||||
|
||||
' e.Cache.DrawImage(oIcon, e.Bounds.X + offsetX, e.Bounds.Y + offsetY, 18, 18)
|
||||
' If oValue.ToString.EndsWith(".pdf") Then
|
||||
' Dim oIcon = My.Resources.pdf
|
||||
' e.Cache.DrawImage(oIcon, e.Bounds.X + 0, e.Bounds.Y + 0, 18, 18)
|
||||
' End If
|
||||
' Catch ex As Exception
|
||||
' Logger.Error(ex)
|
||||
' End Try
|
||||
' End If
|
||||
|
||||
' 'Try
|
||||
' ' If e.RowHandle < 0 Then
|
||||
' ' Exit Sub
|
||||
' ' End If
|
||||
|
||||
' ' e.DefaultDraw()
|
||||
|
||||
' ' Dim oView As GridView = TryCast(sender, GridView)
|
||||
' ' Dim oCellInfo As GridCellInfo = TryCast(e.Cell, GridCellInfo)
|
||||
' ' Dim oRow As DataRow = oView.GetDataRow(e.RowHandle)
|
||||
' ' Dim oValue = oRow.Item(COLUMN_FILENAME)
|
||||
|
||||
' ' If e.Column.FieldName = COLUMN_ICON Then
|
||||
' ' Dim oIcon = Helpers.GetIconByExtension(oValue)
|
||||
' ' Dim offsetX = 0
|
||||
' ' Dim offsetY = 0
|
||||
|
||||
' ' e.Cache.DrawImage(oIcon, e.Bounds.X + offsetX, e.Bounds.Y + offsetY, 18, 18)
|
||||
' ' End If
|
||||
' 'Catch ex As Exception
|
||||
' ' Logger.Error(ex)
|
||||
' 'End Try
|
||||
'End Sub
|
||||
|
||||
Private Sub BarButtonItemExportGrid1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItemExportGrid1.ItemClick
|
||||
|
||||
Reference in New Issue
Block a user