jj: first usable version of lookup grid

This commit is contained in:
Jonathan Jenne
2018-10-12 16:17:18 +02:00
parent 650e6fe365
commit f939e0760c
10 changed files with 100 additions and 62 deletions

View File

@@ -90,30 +90,35 @@ Public Class frmLookupGrid
view.FindFilterText = String.Empty
If MultiSelect Then
Dim values As New List(Of Object)
Dim oValues As New List(Of Object)
For index = 0 To viewLookup.DataRowCount - 1
Dim row As DataRow = view.GetDataRow(index)
Dim selected As Boolean = row.Item(0)
Dim value As Object = row.Item(1)
For oIndex = 0 To viewLookup.DataRowCount - 1
Dim oRow As DataRow = view.GetDataRow(oIndex)
Dim oSelected As Boolean = oRow.Item(0)
Dim oValue As Object = oRow.Item(1)
If selected Then
values.Add(value)
If oSelected Then
oValues.Add(oValue)
End If
Next
' Doppelte Werte entfernen, wenn konfiguriert
If PreventDuplicates Then
values = values.Distinct().ToList()
oValues = oValues.Distinct().ToList()
End If
SelectedValues = values
SelectedValues = oValues
Else
Dim rowHandle As Integer = view.GetSelectedRows().ToList().First()
Dim row As DataRow = view.GetDataRow(rowHandle)
Dim value = row.Item(0)
Dim oRowHandle As Integer = view.GetSelectedRows().ToList().FirstOrDefault()
Dim oRow As DataRow = view.GetDataRow(oRowHandle)
Dim oValues As New List(Of Object)
SelectedValues = New List(Of Object) From {value}
If oRow IsNot Nothing Then
Dim oValue = oRow.Item(0)
oValues.Add(oValue)
End If
SelectedValues = oValues
End If
End Sub