60 lines
2.2 KiB
VB.net
60 lines
2.2 KiB
VB.net
Imports DigitalData.Controls.LookupGrid
|
|
|
|
Public Class frmLookup
|
|
Private _Datasource As List(Of String) = New List(Of String)
|
|
|
|
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
|
For index = 1 To 1000000
|
|
_Datasource.Add($"item-{index}")
|
|
Next
|
|
|
|
Dim oTable = GetDatatable(10)
|
|
LookupControl31.Properties.DataSource = oTable
|
|
LookupControl31.Properties.ValueMember = oTable.Columns.Item(0).ColumnName
|
|
LookupControl31.Properties.DisplayMember = oTable.Columns.Item(0).ColumnName
|
|
LookupControl32.Properties.MultiSelect = True
|
|
|
|
LookupControl32.Properties.DataSource = oTable
|
|
LookupControl32.Properties.ValueMember = oTable.Columns.Item(0).ColumnName
|
|
LookupControl32.Properties.DisplayMember = oTable.Columns.Item(0).ColumnName
|
|
LookupControl32.Properties.MultiSelect = False
|
|
|
|
Dim oEditor As New LookupControl3
|
|
GridControl1.DataSource = New List(Of String) From {"foo", "var"}
|
|
GridControl1.ForceInitialize()
|
|
|
|
Dim oFirstColumn = GridView1.Columns.First()
|
|
Dim oEditor2 As New RepositoryItemLookupControl3() With {
|
|
.DataSource = GetDatatable(10),
|
|
.DisplayMember = "Col1",
|
|
.ValueMember = "Col1"
|
|
}
|
|
|
|
GridControl1.RepositoryItems.Add(oEditor2)
|
|
GridView1.Columns(0).ColumnEdit = oEditor2
|
|
End Sub
|
|
|
|
Private Function GetDatatable(Limit As Integer) As DataTable
|
|
Dim oDatatable As New DataTable
|
|
Dim oColumns As New List(Of DataColumn) From {
|
|
New DataColumn("Col1", GetType(String)),
|
|
New DataColumn("Col2", GetType(String))
|
|
}
|
|
|
|
oDatatable.Columns.AddRange(oColumns.ToArray)
|
|
|
|
For Each Item In _Datasource.Take(Limit)
|
|
Dim oRow = oDatatable.NewRow()
|
|
oRow.Item("Col1") = Item
|
|
oRow.Item("Col2") = Item & "_" & "SomeLong Random(String) !!!111einself"
|
|
oDatatable.Rows.Add(oRow)
|
|
Next
|
|
|
|
Return oDatatable
|
|
End Function
|
|
|
|
Private Sub LookupControl32_EditValueChanged(sender As Object, e As EventArgs) Handles LookupControl32.EditValueChanged, LookupControl33.EditValueChanged
|
|
|
|
End Sub
|
|
End Class
|