ComboBox SORT ??

If you have a question about the software please ask it here.

Re: ComboBox SORT ??

Postby Haik » Thu Jun 21, 2018 6:13 am

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!
Haik
 
Posts: 35
Joined: Fri Sep 08, 2017 6:01 pm

Re: ComboBox SORT ??

Postby Dan911 » Thu Jun 21, 2018 10:20 pm

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
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: ComboBox SORT ??

Postby Dan911 » Fri Jun 22, 2018 10:29 am

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
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: ComboBox SORT ??

Postby Dan911 » Fri Jun 22, 2018 11:23 pm

Happy to help and see you sorted Sort()...lol

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

Dan
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA


Return to Ask a question from support here

Who is online

Users browsing this forum: Bing [Bot] and 8 guests