02-15-2023 09:28 AM
I've sorted my multicolumn listbox depending on the column they click on, however as this reverses the array I'm left with a ton of blank elements at the top and my values all the way at the bottom. I don't know how better to explain, hopefully this will open up a conversation though.
Solved! Go to Solution.
02-15-2023 09:45 AM - edited 02-15-2023 09:46 AM
@TylerHW wrote:
I don't know how better to explain, hopefully this will open up a conversation though.
You can explain better by showing a picture and attaching your VI.
The contents of a listbox is just an indicator (while the "value" is the selected row), so if you have blank rows in your array of items, maybe you want to get rid of them first.
02-15-2023 09:47 AM
Can i "get rid" of them without resizing the listbox? I want to keep it a fixed size
02-15-2023 09:47 AM
this is the before and after sorting by playlist name
02-15-2023 09:49 AM - edited 02-15-2023 09:51 AM
The size of the listbox is cosmetic. You can have a long listbox and only have a few rows of items. Or you can have more items than shown, then you can enable the scrollbar to be able to see all at runtime.
Simply make sure that your array of items has no blank rows and the rest will fall into place.
We can give much more specific advice if you would attach a simplified version of your VI.
02-15-2023 09:52 AM
I'll attach my sorting VI 🙂
02-15-2023 09:57 AM
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
02-15-2023 10:10 AM
Find a way to use "replace array subset", instead of "insert into array".
02-15-2023 10:10 AM
After you read the item names, just eliminate all empty rows before sorting.
Of course a better solution would be to never even have empty rows, so we would need to see the code that populates the listbox in the first place. can you show is the caller?
02-15-2023 10:12 AM
@GRCK5000 wrote:
Find a way to use "replace array subset", instead of "insert into array".
Have you even looked at the code? None of the items you mentioned are even there!