Hi,
Can anyone suggest any code to sort the contents of a checkbox list?
I cannot change the way it is being populated, as it is from a
HashTable, which is used heavily across the application. (Yes, we have
coded ourselves into a bit of a corner!)
I was thinking maybe copy the contents into an Array, then sort the
array, then repopulate the checkboxlist, but got into a bit of a mess
with iComparable.
Any help will be appreciated.
Thanks.
Heres my code so far:
'Sort the items in the checkbox
Dim ArrCheckBoxListItems As Array
Dim LItem As New ListItem
'Next line fails with 'Array cannot be null. Parameter name:
dest'
Me.ChkBxLstLayers.Items.CopyTo(ArrCheckBoxListItem s, 0)
ArrCheckBoxListItems.Sort(ArrCheckBoxListItems)
For Each LItem In Me.ChkBxLstLayers.Items
'Put the items back into the checkboxlist - How?
Next