Compare items selected in GridView (C# Windows Store App) RRS feed

  • Question

  • Hi guys,

    My problem is I want to select two items in GridView and check if they're the same (I used pictures as the items in GridView). If it's true, I'll remove the selected items in GridView. However, I can't find the way to handle the selected items. Could your guys help me to handle two items that was selected and how to check it. Thank for your help!

    Wednesday, March 19, 2014 7:25 AM


  • Use the SelectionChanged event. In the SelectionChangedEventArgs, you can go through the AddedItems to see if they are the same, then remove them if needed.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by Anne Jing Friday, March 28, 2014 6:49 AM
    Wednesday, March 19, 2014 12:16 PM