31 lines
986 B
VB.net
31 lines
986 B
VB.net
Public Class frmLookup
|
|
|
|
Private _Datasource As List(Of String) = New List(Of String)
|
|
|
|
Private Sub frmLookup_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
|
Dim oTable = GetDatatable(10)
|
|
|
|
|
|
LookUpEdit1.Properties.DataSource = oTable
|
|
LookupControl31.Properties.Datasource = oTable
|
|
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
|
|
End Class |