Custom ListView sorting

G

Guest

I am trying to implement custom sorting in a listview. I found the
documentation for doing this but am getting an error when I compile telling
me that a property is not defined.

I am trying to set the ListViewItemSorter property to a custom
implementation of an IComparer. The compiler tells me that
ListViewItemSorter is undefined for a ListView although it is listed in teh
documentation as a property.

Is this a property that is not supported in the Compact Framework version of
..NET?

If so, is there another way to implement custom sorting?

Thanks,

Rob C
 
D

Daniel Moth

Notice how the documentation *does not* say "Supported by the .NET Compact
Framework". That is the first clue; the second of course is that it doesn't
compile (if it did compile, the 3rd clue would be a NotSupported runtime
error).

Typically you catch the columnclick, copy the listviewitems to an arraylist,
sort that and then readd them to the listview. I am sure this has been
discussed in the archives before:
http://groups-beta.google.com/group...tview+sort&qt_g=1&searchnow=Search+this+group

Cheers
Daniel
 
P

Peter Foot [MVP]

In the documentation it's not marked as "Supported by the .NET Compact
Framework". you'll have to sort your collection first before filling the
ListView, e.g. using an ArrayList

Peter
 

Ask a Question

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.

Ask a Question

Top