Multiselect

This commit is contained in:
Jonathan Jenne
2023-08-02 08:11:40 +02:00
parent 5cb526e7a4
commit 080a711067
10 changed files with 634 additions and 421 deletions

View File

@@ -8,6 +8,35 @@ Imports DevExpress.XtraGrid.Views.Base
Imports DevExpress.XtraEditors.Controls
Public Class ClassWindreamDocGrid
' === BEGIN CLASS PART ===
Public Class WindreamDoc
Public Property DocId As Integer
Public Property DocPath As String
Public Property DisplayName As String
Public Property DocType As String
End Class
Private ReadOnly GridView As GridView
Public ReadOnly Property SelectedDocuments As List(Of WindreamDoc)
Get
Return GetSelectedDocuments(GridView)
End Get
End Property
Public ReadOnly Property HasSelectedDocuments As Boolean
Get
Return HasNoSelectedDocuments(GridView)
End Get
End Property
Public Sub New(pGridView As GridView)
GridView = pGridView
End Sub
' === END CLASS PART ===
Private Shared _Helper As ClassHelper
Public Shared SELECTED_DOC_PATH As String
'Public Shared RESULT_OBJECTTYPE As String
@@ -31,12 +60,6 @@ Public Class ClassWindreamDocGrid
Private Shared _textValueChangedHandler As EventHandler
Private Shared _checkValueChangedHandler As EventHandler
Public Class WindreamDoc
Public Property DocId As Integer
Public Property DocPath As String
Public Property DisplayName As String
End Class
Private Shared Function Init_Table()
Try
Dim table As New DataTable With {
@@ -60,7 +83,12 @@ Public Class ClassWindreamDocGrid
End Function
Public Shared Function GetSelectedDocuments(pGridView As GridView)
Public Shared Function HasNoSelectedDocuments(pGridView As GridView) As Boolean
Dim oSelectedRows As List(Of Integer) = pGridView.GetSelectedRows().ToList()
Return oSelectedRows.Count = 0
End Function
Public Shared Function GetSelectedDocuments(pGridView As GridView) As List(Of WindreamDoc)
Dim oSelectedRows As List(Of Integer) = pGridView.GetSelectedRows().ToList()
Dim oDocuments As New List(Of WindreamDoc)
@@ -68,10 +96,12 @@ Public Class ClassWindreamDocGrid
Dim oDocId = pGridView.GetRowCellValue(oRowHandle, "DocID")
Dim oDisplayName = pGridView.GetRowCellValue(oRowHandle, "Displayname")
Dim oDocPath = pGridView.GetRowCellValue(oRowHandle, "FULLPATH")
Dim oDocType = pGridView.GetRowCellValue(oRowHandle, "OBJECTTYPE")
oDocuments.Add(New WindreamDoc With {
.DocId = oDocId,
.DocPath = oDocPath,
.DocType = oDocType,
.DisplayName = oDisplayName
})
Next