LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I insert content into a listbox without sorting alphabetically?

Hello,

 

I have been having trouble figuring out how to add content to a listbox in the order that the content is acquried. I am using a multicolumn listbox as a 'quick report' which shows recent measurement data for the user to view immediately after a measurement is complete. The problem I have is that when a new row is added to the listbox it will sort alphabetically (see quickreport.jpg). I have attempted to make the first column a time stamp and breaking out the name of the file as a row header but nothing seems to work. I think it could just be that I have been looking at this the wrong way and I need a fresh perspective.

 

In the image "quickreport.jpg" you will notice that measurements "a_0001.txt" and "a_0002.txt" were followed in time by "x_0001.txt" and "x_0002.txt" which was then followed by "b_0001.txt". "b_0001.txt gets inserted between "a" and "x" measurements.

 

Any help would be appreciated!

 

Thanks,

amproctor

0 Kudos
Message 1 of 5
(3,035 Views)

It seems nothing is sorted here

list items.PNG

0 Kudos
Message 2 of 5
(3,021 Views)

Thanks NicB,

 

I definitely can make what you describe work. I have found out that the way in which I am actually saving and reading the data is the reason it will not sort according to an index. I use the List Folder function to read measurement files. Thanks for the help but I will have to rewrite most of my program to make this work Where you build your array with the random characters and time stamp I have a compiled 2D array which is out of order. 

 

Anyway, thanks!

 

-amproctor

Message Edited by amproctor on 08-08-2009 09:40 PM
0 Kudos
Message 3 of 5
(3,007 Views)
I don't quite understand what you're looking for. Do you want a sorted list, or an unsorted list? In the image you posted it seems you're using a table control rather than a multicolumn listbox. Either way you're dealing with a 2D array. If you want to sort the 2D array, then get the OpenG Array library. It contains a VI to sort 2D arrays.
0 Kudos
Message 4 of 5
(2,997 Views)

Thanks!

 

This actually will work very well for what I indend to do. I appologize for the poorly phrased question!

 

 

0 Kudos
Message 5 of 5
(2,992 Views)