Common: Fix columns in document result list

This commit is contained in:
Jonathan Jenne 2021-01-07 16:39:22 +01:00
parent ff47ed3471
commit cb0e573cc9
2 changed files with 53 additions and 29 deletions

View File

@ -340,19 +340,24 @@ Public Class frmDocumentResultList
Next
For Each oRow As DataRow In Result.Datatable.Rows
Dim oFullpath = oRow.Item(COLUMN_FILEPATH)
Dim oDocID = oRow.Item(COLUMN_DOCID)
Dim oFilename = Path.GetFileName(oFullpath)
Dim oDocId = TryGetItem(oRow, COLUMN_DOCID)
Dim oFullpath = TryGetItem(oRow, COLUMN_FILEPATH)
Dim oFilename = TryGetItem(oRow, COLUMN_FILENAME)
Dim oNewRow As DataRow
oNewRow = oDocDatatable.NewRow()
'Icon zuweisen
oNewRow.Item(COLUMN_ICON) = _Helpers.GetIconByExtension(oFullpath)
If OperationMode = IResultForm.Mode.NoAppServer Then
oNewRow.Item(COLUMN_ICON) = _Helpers.GetIconByExtension(oFullpath)
oNewRow.Item(COLUMN_FILEPATH) = oFullpath
oNewRow.Item(COLUMN_FILENAME) = oFilename
Else
oNewRow.Item(COLUMN_ICON) = _Helpers.GetIconByExtension(oFilename)
oNewRow.Item(COLUMN_FILEPATH) = String.Empty
oNewRow.Item(COLUMN_FILENAME) = oFilename
End If
'Den Filepath mitgeben
oNewRow.Item(COLUMN_FILEPATH) = oFullpath
oNewRow.Item(COLUMN_DOCID) = oDocID
oNewRow.Item(COLUMN_FILENAME) = oFilename
oNewRow.Item(COLUMN_DOCID) = oDocId
Dim oIndex = 4 'Fängt bei 4 an, um die definierten Spalten zu überspringen
For Each oColumnName As String In oRestColArray
@ -387,6 +392,8 @@ Public Class frmDocumentResultList
If OperationMode = IResultForm.Mode.WithAppServer Then
' Hide Fullpath completely in AppServer Mode
GridView.Columns.Item(COLUMN_FILEPATH).OptionsColumn.ShowInCustomizationForm = False
GridView.Columns.Item(COLUMN_ICON).Visible = False
GridView.Columns.Item(COLUMN_FILEPATH).Visible = False
End If
Dim oCreatedColumn = GridView.Columns(oCreated)
@ -401,7 +408,7 @@ Public Class frmDocumentResultList
oChangedColumn.DisplayFormat.FormatString = _Environment.User.DateFormat & " HH:MM:ss"
End If
' Alle Spalten aus ReadOnly setzen, danach werden alle passenden auf nicht ReadOnly gesetzt
' Alle Spalten auf ReadOnly setzen, danach werden alle passenden auf nicht ReadOnly gesetzt
For Each oColumn As GridColumn In GridView.Columns
oColumn.OptionsColumn.AllowEdit = False
Next
@ -419,6 +426,14 @@ Public Class frmDocumentResultList
End Try
End Sub
Private Function TryGetItem(DataRow As DataRow, ColumnName As String, Optional DefaultValue As String = "") As String
Try
Return DataRow.Item(ColumnName)
Catch ex As Exception
Return DefaultValue
End Try
End Function
Private Sub SwitchMainContainerHorizontal_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles SwitchMainContainerHorizontal.CheckedChanged
SplitContainerControl1.Horizontal = SwitchMainContainerHorizontal.Checked

View File

@ -76,6 +76,7 @@ Partial Class frmSearchStart
Me.KlammerRechtsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.KlammerEntfernenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.SplitContainerControlSearch = New DevExpress.XtraEditors.SplitContainerControl()
Me.BarButtonItem4 = New DevExpress.XtraBars.BarButtonItem()
CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.RepositoryItemRadioGroup1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.RepositoryItemComboBox1, System.ComponentModel.ISupportInitialize).BeginInit()
@ -103,16 +104,16 @@ Partial Class frmSearchStart
Me.RibbonControl1.AutoSizeItems = True
Me.RibbonControl1.CaptionBarItemLinks.Add(Me.BarButtonItem2)
Me.RibbonControl1.ExpandCollapseItem.Id = 0
Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.BarButtonItem2, Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.BarButtonNewSearch, Me.BarButtonSaveSearch, Me.BarHeaderItem1, Me.BarEditItem1, Me.BarButtonClearSearch, Me.BarButtonItem3, Me.BarEditItem2, Me.BarStaticItemInfo, Me.BarButtonStartSearch, Me.BarStaticItem1, Me.txtFilterFrom, Me.txtFilterTo, Me.cmbFilterTimeframe, Me.BarCheckboxOpenSearchInSameWindow, Me.BarButtonItem1})
Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.BarButtonItem2, Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.BarButtonNewSearch, Me.BarButtonSaveSearch, Me.BarHeaderItem1, Me.BarEditItem1, Me.BarButtonClearSearch, Me.BarButtonItem3, Me.BarEditItem2, Me.BarStaticItemInfo, Me.BarButtonStartSearch, Me.BarStaticItem1, Me.txtFilterFrom, Me.txtFilterTo, Me.cmbFilterTimeframe, Me.BarCheckboxOpenSearchInSameWindow, Me.BarButtonItem1, Me.BarButtonItem4})
Me.RibbonControl1.Location = New System.Drawing.Point(0, 0)
Me.RibbonControl1.MaxItemId = 24
Me.RibbonControl1.MaxItemId = 25
Me.RibbonControl1.Name = "RibbonControl1"
Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1})
Me.RibbonControl1.RepositoryItems.AddRange(New DevExpress.XtraEditors.Repository.RepositoryItem() {Me.RepositoryItemRadioGroup1, Me.RepositoryItemComboBox1, Me.RepositoryItemTextEdit1, Me.RepositoryItemDateEdit1, Me.RepositoryItemDateEdit2, Me.RepositoryItemComboBox2, Me.RepositoryItemTimeSpanEdit1})
Me.RibbonControl1.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False]
Me.RibbonControl1.ShowItemCaptionsInCaptionBar = True
Me.RibbonControl1.ShowPageHeadersMode = DevExpress.XtraBars.Ribbon.ShowPageHeadersMode.Hide
Me.RibbonControl1.Size = New System.Drawing.Size(1020, 131)
Me.RibbonControl1.Size = New System.Drawing.Size(1020, 132)
Me.RibbonControl1.StatusBar = Me.RibbonStatusBar1
'
'BarButtonItem2
@ -316,10 +317,11 @@ Partial Class frmSearchStart
'RibbonStatusBar1
'
Me.RibbonStatusBar1.ItemLinks.Add(Me.BarStaticItemInfo)
Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 455)
Me.RibbonStatusBar1.ItemLinks.Add(Me.BarButtonItem4)
Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 453)
Me.RibbonStatusBar1.Name = "RibbonStatusBar1"
Me.RibbonStatusBar1.Ribbon = Me.RibbonControl1
Me.RibbonStatusBar1.Size = New System.Drawing.Size(1020, 22)
Me.RibbonStatusBar1.Size = New System.Drawing.Size(1020, 24)
'
'pnlProfileChoose
'
@ -328,7 +330,7 @@ Partial Class frmSearchStart
Me.pnlProfileChoose.Controls.Add(Me.Label1)
Me.pnlProfileChoose.Dock = System.Windows.Forms.DockStyle.Top
Me.pnlProfileChoose.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.pnlProfileChoose.Location = New System.Drawing.Point(0, 131)
Me.pnlProfileChoose.Location = New System.Drawing.Point(0, 132)
Me.pnlProfileChoose.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3)
Me.pnlProfileChoose.Name = "pnlProfileChoose"
Me.pnlProfileChoose.Size = New System.Drawing.Size(1020, 57)
@ -364,68 +366,68 @@ Partial Class frmSearchStart
Me.XtraTabControl1.MultiLine = DevExpress.Utils.DefaultBoolean.[False]
Me.XtraTabControl1.Name = "XtraTabControl1"
Me.XtraTabControl1.SelectedTabPage = Me.XtraTabPage1
Me.XtraTabControl1.Size = New System.Drawing.Size(1020, 267)
Me.XtraTabControl1.Size = New System.Drawing.Size(1020, 264)
Me.XtraTabControl1.TabIndex = 12
Me.XtraTabControl1.TabPages.AddRange(New DevExpress.XtraTab.XtraTabPage() {Me.XtraTabPage1, Me.XtraTabPage2, Me.XtraTabPage3, Me.XtraTabPage4, Me.XtraTabPage5, Me.XtraTabPage6, Me.XtraTabPage7, Me.XtraTabPage8, Me.XtraTabPage9, Me.XtraTabPage10})
'
'XtraTabPage1
'
Me.XtraTabPage1.Name = "XtraTabPage1"
Me.XtraTabPage1.Size = New System.Drawing.Size(1018, 244)
Me.XtraTabPage1.Size = New System.Drawing.Size(1018, 239)
Me.XtraTabPage1.Text = "Search#1"
'
'XtraTabPage2
'
Me.XtraTabPage2.Name = "XtraTabPage2"
Me.XtraTabPage2.Size = New System.Drawing.Size(1018, 244)
Me.XtraTabPage2.Size = New System.Drawing.Size(1018, 242)
Me.XtraTabPage2.Text = "Search#2"
'
'XtraTabPage3
'
Me.XtraTabPage3.Name = "XtraTabPage3"
Me.XtraTabPage3.Size = New System.Drawing.Size(1018, 244)
Me.XtraTabPage3.Size = New System.Drawing.Size(1018, 242)
Me.XtraTabPage3.Text = "Search#3"
'
'XtraTabPage4
'
Me.XtraTabPage4.Name = "XtraTabPage4"
Me.XtraTabPage4.Size = New System.Drawing.Size(1018, 244)
Me.XtraTabPage4.Size = New System.Drawing.Size(1018, 242)
Me.XtraTabPage4.Text = "Search#4"
'
'XtraTabPage5
'
Me.XtraTabPage5.Name = "XtraTabPage5"
Me.XtraTabPage5.Size = New System.Drawing.Size(1018, 244)
Me.XtraTabPage5.Size = New System.Drawing.Size(1018, 242)
Me.XtraTabPage5.Text = "Search#5"
'
'XtraTabPage6
'
Me.XtraTabPage6.Name = "XtraTabPage6"
Me.XtraTabPage6.Size = New System.Drawing.Size(1018, 244)
Me.XtraTabPage6.Size = New System.Drawing.Size(1018, 242)
Me.XtraTabPage6.Text = "Search#6"
'
'XtraTabPage7
'
Me.XtraTabPage7.Name = "XtraTabPage7"
Me.XtraTabPage7.Size = New System.Drawing.Size(1018, 244)
Me.XtraTabPage7.Size = New System.Drawing.Size(1018, 242)
Me.XtraTabPage7.Text = "Search#7"
'
'XtraTabPage8
'
Me.XtraTabPage8.Name = "XtraTabPage8"
Me.XtraTabPage8.Size = New System.Drawing.Size(1018, 244)
Me.XtraTabPage8.Size = New System.Drawing.Size(1018, 242)
Me.XtraTabPage8.Text = "Search#8"
'
'XtraTabPage9
'
Me.XtraTabPage9.Name = "XtraTabPage9"
Me.XtraTabPage9.Size = New System.Drawing.Size(1018, 244)
Me.XtraTabPage9.Size = New System.Drawing.Size(1018, 242)
Me.XtraTabPage9.Text = "Search#9"
'
'XtraTabPage10
'
Me.XtraTabPage10.Name = "XtraTabPage10"
Me.XtraTabPage10.Size = New System.Drawing.Size(1018, 244)
Me.XtraTabPage10.Size = New System.Drawing.Size(1018, 242)
Me.XtraTabPage10.Text = "Search#10"
'
'ContextMenuStripSearchTerms
@ -464,16 +466,22 @@ Partial Class frmSearchStart
Me.SplitContainerControlSearch.CollapsePanel = DevExpress.XtraEditors.SplitCollapsePanel.Panel2
Me.SplitContainerControlSearch.Dock = System.Windows.Forms.DockStyle.Fill
Me.SplitContainerControlSearch.FixedPanel = DevExpress.XtraEditors.SplitFixedPanel.Panel2
Me.SplitContainerControlSearch.Location = New System.Drawing.Point(0, 188)
Me.SplitContainerControlSearch.Location = New System.Drawing.Point(0, 189)
Me.SplitContainerControlSearch.Name = "SplitContainerControlSearch"
Me.SplitContainerControlSearch.Panel1.Controls.Add(Me.XtraTabControl1)
Me.SplitContainerControlSearch.Panel1.Text = "Panel1"
Me.SplitContainerControlSearch.Panel2.Text = "Panel2"
Me.SplitContainerControlSearch.PanelVisibility = DevExpress.XtraEditors.SplitPanelVisibility.Panel1
Me.SplitContainerControlSearch.Size = New System.Drawing.Size(1020, 267)
Me.SplitContainerControlSearch.Size = New System.Drawing.Size(1020, 264)
Me.SplitContainerControlSearch.SplitterPosition = 310
Me.SplitContainerControlSearch.TabIndex = 16
'
'BarButtonItem4
'
Me.BarButtonItem4.Caption = "BarButtonItem4"
Me.BarButtonItem4.Id = 24
Me.BarButtonItem4.Name = "BarButtonItem4"
'
'frmSearchStart
'
Me.AllowFormGlass = DevExpress.Utils.DefaultBoolean.[True]
@ -566,4 +574,5 @@ End Sub
Friend WithEvents BarButtonItem1 As DevExpress.XtraBars.BarButtonItem
Friend WithEvents BarButtonItem2 As DevExpress.XtraBars.BarButtonItem
Friend WithEvents RibbonPageGroup1 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
Friend WithEvents BarButtonItem4 As DevExpress.XtraBars.BarButtonItem
End Class