SelectedItems.count do not change making single selection after multiple selection.

6 posts, 0 answers
  1. Riyadh
    Riyadh avatar
    4 posts
    Member since:
    Jan 2015

    Posted 10 Sep 2015 Link to this post

    Hello,

    I am catching MouseLeftButtonUp event. I select multiple items and then select one item from that multiple selected item (The focus and selection is now in one item). When MouseLeftButtonUp fires, it still displays the multiple selection count in SelectedItems.count. Is it a bug? how to do a work around? Thanks in advance. I am using file version 2015.2.728.45 Telerik.Windows.Controls.dll.

  2. Martin Vatev
    Admin
    Martin Vatev avatar
    87 posts

    Posted 12 Sep 2015 Link to this post

    Hi Riyadh,

    I tried a similar solution with the selection of items on my side and I was not able to reproduce the problem. SelectedItems.Count always returns the correct value. Attached you can find the project I used for the test. Note, that the MouseLeftButtonUp event is handled internally by RadGridView. 
    Can you please explain your intention to handling the event?

    Regards,
    Martin Vatev
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Riyadh
    Riyadh avatar
    4 posts
    Member since:
    Jan 2015

    Posted 14 Sep 2015 Link to this post

    Hello Martin Vatev,

    Thank you for the replay. You are right. MouseLeftButtonUp does return the currect SelecteItems.Count. I was firing the PreviewMouseLeftButtonUp. I have fixed the code.

  5. Riyadh
    Riyadh avatar
    4 posts
    Member since:
    Jan 2015

    Posted 14 Sep 2015 Link to this post

    However the MouseLeftButtonUp event is not firing. That is the reason I
    used PreviewMouseLeftButtonUp. How can I send the Project to you to check the problem?
  6. Martin Vatev
    Admin
    Martin Vatev avatar
    87 posts

    Posted 15 Sep 2015 Link to this post

    Hi Riyadh,

    Instead of using PreviewMouseLeftButtonUp and MouseLeftButtonUp events I recommend you to use SelectionChanged  event.  When it fires, it displays the correct count in SelectedItems.count.

    I hope this helps.

    Regards,
    Martin Vatev
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  7. Riyadh
    Riyadh avatar
    4 posts
    Member since:
    Jan 2015

    Posted 15 Sep 2015 Link to this post

    Thanks Martin. I have already got a solution from your support team.

    telerik_RadTreeListView.AddHandler(Control.MouseLeftButtonUpEvent, new MouseButtonEventHandler(this.telerik_RadTreeListView_MouseLeftButtonUp), true);​

    Now the even is firing properly.

     

Back to Top
UI for WPF is Visual Studio 2017 Ready