Page 1 of 1

Re: ComboBox SORT ??

PostPosted: Thu Jun 21, 2018 6:13 am
by Haik
The short answer is:
comboBox1.Sorted = true;
This may not give you the level of control you need. I often use a datatable and apply sorting there and then bind my comboBox to that. There are several ways to accomplish sorting, it really depends on your UX needs.

Hope this helps!

Re: ComboBox SORT ??

PostPosted: Thu Jun 21, 2018 10:20 pm
by Dan911
Hi Terry,
I have to say when I first read this in morning before work I thought there was a simple solution but didn't have time to play and expected to
read tonight 1 or more solutions. Simple??? Plugin yes macro not so much, at least not until function is added.

A work around would be write string to a listbox and sort it than write to the combobox.

Code: Select all
if (result == false)
 {
 Mylist.Add(Mystring);
 Mylist.Sort();
 AS3.Clearcomboboxitems(2222);

foreach (string value in Mylist)

{AS3.Addcomboboxitem(value, 2222);}

result = true;
}

#Events

List<string> Mylist = new List<string>();


Dan

Re: ComboBox SORT ??

PostPosted: Fri Jun 22, 2018 10:29 am
by Dan911
The approach I probably would take is run macro in a loop. Add a List<string> to your #Events and create a first run bool where you populate the combobox list. I would eliminate the button and use combobox selection to run wizard with a condition so don't continually run until changed.

Nice work!

Dan

Re: ComboBox SORT ??

PostPosted: Fri Jun 22, 2018 11:23 pm
by Dan911
Happy to help and see you sorted Sort()...lol

Sorry to see you come across new issues from other threads I read.

Dan