Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting listbox

Status
Not open for further replies.

Annieken

Programmer
Mar 18, 2008
1
BE
Hi all

I've got two listboxs: listbox3 and listbox4
In listbox3 there has to be a member of listbox1. But only one member. This listbox3 has also be sorted by another member (also of listbox1)

In listbox4 I have to display the properties of the selected item in listbox3.

Example:

Listbox1:
PNaam: First - PNr 2 - PAankomst 4 - Pstatus New
PNaam: Second - PNr 9 - PAankomst 8 - Pstatus Wait
PNaam: Last - PNr 2 - PAankomst 5 - Pstatus New

In ListBox3 there has to be (according by PAankomst)
First
Last
Second

In listbox4 there has to be (when selecting Second)

PNr 9 - PAankomst 8 - Pstatus Wait


any idea's?
 
Do you want to sort the list so that all the items still exist or are you filtering the items available in the new list based on a selection from the first?

And are you using a listbox or a listview? If you have columns, then use a Listview and set the ViewMode to "Details" and add columns.

In order to do a simple sort on a listview you just need to set the Comparer property in code to a custom comparer that you create (IComparer).

MSDN has some good articles on this.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top