Listbox Unselect Event

4 posts, 0 answers
  1. jerry
    jerry avatar
    103 posts
    Member since:
    Feb 2008

    Posted 18 Feb 2010 Link to this post

    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
  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 18 Feb 2010 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. jerry
    jerry avatar
    103 posts
    Member since:
    Feb 2008

    Posted 18 Feb 2010 Link to this post

    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


  5. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 19 Feb 2010 Link to this post

    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.
Back to Top