LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to sort a multiple lined listbox?

Hi,
I want to sort in my listbox, "just like i can do in windows, by pressing
the bar that says for example name, size, type etc..." So i want to make a
multiple lined listbox with a "sort" button but then the other column must
come a long withe the sorted one!

Does anyone knows how to make this?

Best regards,
Thijs
0 Kudos
Message 1 of 2
(2,484 Views)
Your listview takes a 2D array of strings. What you're really asking here is
how do you sort that based on an arbitrary column. A brute force approach is
to feed your array into a FOR loop, autoindexed. Make sure that the auto
index is pulling out row by row. Extract the element corresponding to the
column you want. Bundle it with the entire row, making sure the single
element is first in the cluster. Feed that out of the loop, you'll get a 1D
array of clusters. Sort 1D array; with clusters this acts on the first
element. Feed the sorted array into another FOR loop, re-build the form of
the original array, which will now be sorted on the column you want.

I assume there's no problem with making a row of Booleans along the top of
the table as a fake, clickable he
ader line.

--
Craig Graham
Physicist/Labview Programmer
Lancaster University, UK

"Thijs Boeree" wrote in message
news:1011880139.272445@sphere.amc.uva.nl...
> Hi,
> I want to sort in my listbox, "just like i can do in windows, by pressing
> the bar that says for example name, size, type etc..." So i want to make a
> multiple lined listbox with a "sort" button but then the other column must
> come a long withe the sorted one!
>
> Does anyone knows how to make this?
>
> Best regards,
> Thijs
>
>
0 Kudos
Message 2 of 2
(2,484 Views)