Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Strange ListBox and ComboBox behavior
Mon, May 25 2015 7:38 AMPermanent Link

Eivind

All

I started to use alot of ButtonComboBox and ListBoxes in my projects. Most of the times, they are loaded with data from a database, and re-loaded with data once a user selects another value in a parent ComboBox or ListBox. All the times I call the ListBox / ButtonComboBox.Items.Clear fucntion and even set the ItemIndex to 0. However, they seem to have some "memory" of previously selected items. Once data is cleared and reloaded, the last selection sticks. See the attached VDO for details. For the ListBox, Multiselect is at it's default false value. For the ButtonComboBox, there is no Multiselect, the same thing will happen there as well.

Very confusing for my testers and users Smile

Anyone else see this behavior?



Attachments: IMG.mp4
Tue, May 26 2015 1:40 AMPermanent Link

Eivind

Alright, I'll answer my own post Smile

As I had a client demo today, I really had to find a way around this issue. As ComboBox / ListBox.Items.Clear really does not clean up thoroughly, I had to  find my own way. The solution was to iterate through the items and call the ComboBox / ListBox.Items.Delete(I). This seams to do the trick and thoroughly clean up before new items where added.

I may guess that Items.Clear should do this as well, so this might be a small bug-fix for further releases? Or I may be wrong Smile

Cheers

Eivind


Eivind wrote:

All

I started to use alot of ButtonComboBox and ListBoxes in my projects. Most of the times, they are loaded with data from a database, and re-loaded with data once a user selects another value in a parent ComboBox or ListBox. All the times I call the ListBox / ButtonComboBox.Items.Clear fucntion and even set the ItemIndex to 0. However, they seem to have some "memory" of previously selected items. Once data is cleared and reloaded, the last selection sticks. See the attached VDO for details. For the ListBox, Multiselect is at it's default false value. For the ButtonComboBox, there is no Multiselect, the same thing will happen there as well.

Very confusing for my testers and users Smile

Anyone else see this behavior?
Tue, May 26 2015 7:55 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Eivind,

<< I started to use alot of ButtonComboBox and ListBoxes in my projects.
Most of the times, they are loaded with data from a database, and re-loaded
with data once a user selects another value in a parent ComboBox or ListBox.
All the times I call the ListBox / ButtonComboBox.Items.Clear fucntion and
even set the ItemIndex to 0. However, they seem to have some "memory" of
previously selected items. Once data is cleared and reloaded, the last
selection sticks. See the attached VDO for details. For the ListBox,
Multiselect is at it's default false value. For the ButtonComboBox, there is
no Multiselect, the same thing will happen there as well.  >>

This is now fixed.  It was simply not clearing the selected set when the
items changed.

Tim Young
Elevate Software
www.elevatesoft.com
Wed, May 27 2015 12:38 AMPermanent Link

Eivind

Brilliant. Thanks Tim!


"Tim Young [Elevate Software]" wrote:

Eivind,

<< I started to use alot of ButtonComboBox and ListBoxes in my projects.
Most of the times, they are loaded with data from a database, and re-loaded
with data once a user selects another value in a parent ComboBox or ListBox.
All the times I call the ListBox / ButtonComboBox.Items.Clear fucntion and
even set the ItemIndex to 0. However, they seem to have some "memory" of
previously selected items. Once data is cleared and reloaded, the last
selection sticks. See the attached VDO for details. For the ListBox,
Multiselect is at it's default false value. For the ButtonComboBox, there is
no Multiselect, the same thing will happen there as well.  >>

This is now fixed.  It was simply not clearing the selected set when the
items changed.

Tim Young
Elevate Software
www.elevatesoft.com
Image