From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to move elements to top of multicolumn listbox after it's been sorted

Solved!
Go to solution

@TylerHW wrote:

Also, i want to keep the scroll bar incase they add more elements than i have rows and the listbox will stay the same size


You can have the scrollbar always visible. It does not depend on the number of actual items.

0 Kudos
Message 11 of 22
(732 Views)

Lol, i was going to say the same.

 

Thanks for  you response earlier, I had a look at the caller and it was initialising a load of unwanted cells xD

TylerHW_0-1676477774434.png

I've changed it now and it seems to be working 🙂

TylerHW_1-1676477828323.png

TylerHW_2-1676477863988.pngTylerHW_3-1676477869943.png

 

0 Kudos
Message 12 of 22
(731 Views)

Of course you can eliminate empty rows also as follows:

 

altenbach_0-1676477955663.png

 

Message 13 of 22
(730 Views)

@TylerHW wrote:

 

I've changed it now and it seems to be working 🙂

TylerHW_1-1676477828323.png


You still have a 2D string array constant with at least one element. I would recommend to start with an empty array instead.

(right-click array container ... data operations... empty array)

 

Of course you don't really need that code at all if the subVI would write the playlist from scratch instead of appending. Hard to give advice without seeing all code.

0 Kudos
Message 14 of 22
(726 Views)

No worries, it's working how I need it to now so that's all that matters, it's for a uni exam so I just need it to work xD 

0 Kudos
Message 15 of 22
(722 Views)

Thought it was fine, nevermind.. I seem to be having an issue where I'm now not initialising enough cells for data to go into. However if I initialise too many I'll have blank spaces, and while the data is in memory it won't actually get displayed on the listbox as there isn't enough ItemNames initialised in the array. Any help?

0 Kudos
Message 16 of 22
(695 Views)

This is cool. I remembered working on the project where I had to log data on the table and I was struggling with removing empty cells. Thanks Mr. Altenbach for sharing. 

Mr @altenbach, I don't think this helps remove empty cells. 

 

GRCK5000_0-1676486717473.png

GRCK5000_1-1676486800507.png

 

 

 

 

 

0 Kudos
Message 17 of 22
(687 Views)

@GRCK5000 wrote:

Mr @altenbach, I don't think this helps remove empty cells. 


you cannot remove empty single cells in a 2D array because all rows need to be the same size. You can easily change the logic to only retain rows that don't have any empty string element at all.

0 Kudos
Message 18 of 22
(675 Views)

@TylerHW wrote:

Thought it was fine, nevermind.. I seem to be having an issue where I'm now not initialising enough cells for data to go into. However if I initialise too many I'll have blank spaces, and while the data is in memory it won't actually get displayed on the listbox as there isn't enough ItemNames initialised in the array. Any help?


If you correctly build your array of items, there is no need to initialize anything. If you would show us a simplified version of how you do it, we can show you the correct way. Where does the data come from?

0 Kudos
Message 19 of 22
(669 Views)

So the data is coming from xml files containing clusters, i'm using the info inside these files to populate the lists. But these lists need to be pre-initialised in order for me to parse the contents of the files into the the ItemNames cell. It would take far too long for me to explain the whole architecture.

If you wanted, if you have something like discord or some other means of communication it would probably be easier for me to show you my requirements and we could discuss them over messages

0 Kudos
Message 20 of 22
(661 Views)