01-16-2015 10:06 AM
Maybe I am not being clear. What I am after for is a wildcard search on the 1D array. After the characters are entered, like Eri, I want a wildcard search for any other characters after the initial characters are entered into the Search string control.
OK, so don't try my algorithm! Yes, it's a bit more work, but you can also modify Crossrulz's Sequential Search by using some clever thinking and reading what you, yourself, wrote (quoted above -- "I want a wildcard search ...", so do a wildcard search!). You'll need to think about how to better handle the "not found" condition, and also think what happens when you are looking for Zelda on a really long list of contacts (you'll have to search the entire list on every character you enter ...).
BS
01-16-2015 10:17 AM - edited 01-16-2015 10:19 AM
I think I figured it out after just stepping back for a moment.
I had to use Subset Array along with the string length to compare against each element in the 1D array. Once I found a match using the Greater than Zero primitive, I just used the iteration terminal to feed the MultiColumn Listbox value.
Attached is a snippet in case anyone else needs to use this for a project.
01-16-2015 10:42 AM
One more question that relates to this. Since I can now select the row programmactically, how do I make the highlighted item visible without having to manually scroll up/down?
01-16-2015 10:52 AM
I'm not sure what you mean by "make the highlighted item visible". I've not worked with MCListboxes, myself, but I assume that you can set the Active Cell (the one you find programmatically) with the ActiveCell property. Do you need something other than that?
BS
01-16-2015 12:13 PM - edited 01-16-2015 12:14 PM
What I meant was, when I find a match, the row becomes highlighted. The multicolumn listbox only has about 15 names visible to the user. If it goes beyond the visible selections, I want to force the multicolumn listbox to automaticlly scroll to the selection without the user doing this manually.
01-16-2015 12:25 PM
There is a property called Top Left Visible Cell. If you set that to the selected row, then your selected item will be at the top.