Multiselect
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user