Dim dv As DataView = DAL.GetData.DefaultView
dv.RowFilter = "SomeField = '" & value1 & "'"
cbo2.BeginUpdate()
cbo2.Items.Clear()
For Each drv As DataRowView In dv
cbo2.Items.Add(New ListBoxItem(drv("CBO2_DATA").ToString,
drv("CBO2_TEXT").ToString))
Next
cbo2.EndUpdate()
End Sub
' helper class...
Public Class ListBoxItem
Private listItemData As Object
Private listItemText As String
' This is what is displayed in the ComboBox drop-down
Public Overrides Function ToString() As String
Return listItemText
End Function
Public Sub New(ByVal itemData As Object, ByVal itemText As String)
listItemData = itemData
listItemText = itemText
End Sub
Public ReadOnly Property Data() As Object
Get
Data = listItemData
End Get
End Property
Public ReadOnly Property Text() As String
Get
Text = listItemText
End Get
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.