This is a migrated thread and some comments may be shown as answers.

Listbox Unselect Event

3 Answers 95 Views
ComboBox and ListBox (obsolete as of Q2 2010)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
jerry
Top achievements
Rank 1
jerry asked on 18 Feb 2010, 03:07 PM
Is there an event for when the user unselects a row within a list box?
I'm displaying the number of items that are selected within the listbox.  When I'm selecting a row the SelectedIndexChanged event fires and updated the label correctly with the number of items in the SelectedItems array.  But when I deselect/unselect no event fires unless I change rows.  I need to find a way to do this right when the user deselects/unselects the row.

Thank You

3 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 18 Feb 2010, 03:17 PM
Hi jerry,

You can use SelectedItems.CollectionChanged event and process the Remove action.

Regards,
Victor
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
jerry
Top achievements
Rank 1
answered on 18 Feb 2010, 03:48 PM
Victor,
Thank you so much for the quick reply.

I added this line to my form load and it works.

this.lstVar.SelectedItems.CollectionChanged += new RadListBoxItemCollectionChangedEventHandler(this.lstVar_SelectedItems_Collection_Changed);

Is that the best place to put it?

Thank You
Jerry


0
Victor
Telerik team
answered on 19 Feb 2010, 08:42 AM
Hello jerry,

Currently there is no other place to handle this case. We will add events for deselecting items in a future release. Thank you for the feedback.

Kind regards,
Victor
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
ComboBox and ListBox (obsolete as of Q2 2010)
Asked by
jerry
Top achievements
Rank 1
Answers by
Victor
Telerik team
jerry
Top achievements
Rank 1
Share this question
or