A
active
Can you see why this does not sort the list?
It displays OK but is not sorted
Thanks for any help
Private mItemList As List(Of StringWithInteger) = New List(Of
StringWithInteger)
'StringWithInteger has properties Strng and Numb
....
GenericComboBox1.BindingSourceDataSource = mItemList
GenericComboBox1.ItemDisplayMember = "Strng"
GenericComboBox1.ItemValueMember = "Numb"
GenericComboBox1.SortItNow("Strng ASC")
GenericComboBox1.SetDataSource()
Public Class GenericComboBox
Inherits System.Windows.Forms.ComboBox
#Region " Windows Form Designer generated code "
....
Public BindingSource1 As BindingSource = New BindingSource()
Public WriteOnly Property BindingSourceDataSource() As Object
Set(ByVal itemList As Object)
BindingSource1.DataSource = itemList
End Set
End Property
Public Sub SetDataSource()
Me.DataSource = BindingSource1
End Sub
Public Sub SortItNow(ByVal sortString As String)
BindingSource1.Sort = sortString
End Sub
End Class
It displays OK but is not sorted
Thanks for any help
Private mItemList As List(Of StringWithInteger) = New List(Of
StringWithInteger)
'StringWithInteger has properties Strng and Numb
....
GenericComboBox1.BindingSourceDataSource = mItemList
GenericComboBox1.ItemDisplayMember = "Strng"
GenericComboBox1.ItemValueMember = "Numb"
GenericComboBox1.SortItNow("Strng ASC")
GenericComboBox1.SetDataSource()
Public Class GenericComboBox
Inherits System.Windows.Forms.ComboBox
#Region " Windows Form Designer generated code "
....
Public BindingSource1 As BindingSource = New BindingSource()
Public WriteOnly Property BindingSourceDataSource() As Object
Set(ByVal itemList As Object)
BindingSource1.DataSource = itemList
End Set
End Property
Public Sub SetDataSource()
Me.DataSource = BindingSource1
End Sub
Public Sub SortItNow(ByVal sortString As String)
BindingSource1.Sort = sortString
End Sub
End Class