Refreshing Listbox from dropdown selection

Hey,

Is there a way to refresh a listbox? i.e. The user selects a value from the dropdown which should change the contents of the list box to reflect this.

Attached is the classic fruit example, but I can’t get the list to update. I’ve tried the Application.Instance.Invoke under the event handler, but it doesn’t refresh the list. Should that be in the dialog part instead, or something else?

Fruit script attached (as part of a larger script, hence the table layout)

Trimmed Drop-List Select.py (5.6 KB)

Thanks!
Dan

Hey @Dan_Cornick,

I think you have a wee typo:

self.m_listbox.DataStore == Apples

should be

self.m_listbox.DataStore = Apples

Seems to work after that change.

Hope this helps!

1 Like

Haha, how’d I miss that one! Thanks @curtisw ! :slight_smile:

1 Like