locked
How to detect index of dropped item between ListView and GridView

    Question

  • the Drag and Drop with ListView and GridView Works Fine.

    But now I want to detect the index of dropped item, for example if I drop my item of ListView  in the third item of My  Gridview I want to get the Index as 3. I don't know how it works I think maybe with detecting the index dropped item with  the mouse over.

    Thank you

    Wednesday, April 16, 2014 6:21 PM

Answers

  • Hi Anis,

    "I want to detect the index of dropped item".

    A stupid solution: you can save your original items list and when drag event finishes, compare with the new item list. I don't think there is any directly API for you to detect the item change.

    Another solution: if you listview item is binding to a Observable collection, you can fire a CollectionChanged event which contains a NotifyCollectionChangedEventArgs Class, you can find something you need there.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, April 17, 2014 3:41 AM
    Moderator