WPF & Sorting ListBox

  • Thread starter Thread starter hufaunder
  • Start date Start date
H

hufaunder

I need to sort the items within a list box. Besides the manual way the
only solution I know is by adding a SortDescriptions to the items
collection. The problem is that SortDescriptions needs a property. The
items in my list box are of type String, though. The only property
available in String is Length. So how can I sort such a list? Also,
how can I sort it in a none-case sensitive way?

Thanks
 
I would say make the propertyname null, or an empty string. If this
doesn't work, then I would consider using a data table with a single column
(although that seems like overkill) and bind to that, which would then be
sortable.
 
Back
Top