Hi hope someone can help,
I'm trying to bind an UltraCombo against data from a Generic.Dictionary collection object using the following code in the load event of a composite user control:
Dim BookingOrderItems As New System.Collections.Generic.Dictionary(Of BookingOrderEnum, String) With BookingOrderItems .Add(BookingOrderEnum.Any, "Any") .Add(BookingOrderEnum.HolidayBeforeTOIL, "TOIL before holiday").Add(BookingOrderEnum.TOILBeforeHoliday, "Holiday before TOIL")
.Add(BookingOrderEnum.Any,
.Add(BookingOrderEnum.HolidayBeforeTOIL,
End With
.ValueMember =
.DisplayMember =
.DataSource = BookingOrderItems
This results in a System.NullReferenceException at the point where i assign BookingOrderItems object to the data source property.
If i change the above code to use a simple Generic.List of strings as in the following code then the everything works fine.
Dim BookingOrderItems As New System.Collections.Generic.List(Of String)
With BookingOrderItems
.Add("Any") .Add("TOIL before holiday") .Add("Holiday before TOIL") End With
.Add("Any") .Add("TOIL before holiday") .Add("Holiday before TOIL")
.Add(
Me.ultracomboBookingOrder.DataSource = BookingOrderItems
I would therefore assume i'm missing something in how i'm going about setting up the binding.
Please excuse any obvious errors in the above code as i'm new to using the UltraCombo.
Thanks for any help,
Simon.