0

I have a GridView with a custom template. I want the user to be able to drop some of items on another items. I enabled the drag & drop and added the drop handler to the Grid which is used for item's template:

        <GridView.ItemTemplate>
            <DataTemplate>
                <Grid HorizontalAlignment="Left" Width="250" Height="250" AllowDrop="True" Drop="content_Drop">

With the code above, I'm able to handle which Grid the user has dropped the item onto. However, I'm not able to get the object for this Grid. A trick (using an invisible control and lookup) comes to my mind but I'm looking for a better way.

Alireza Noori
  • 14,961
  • 30
  • 95
  • 179

1 Answers1

1

The DataContext property of the Grid will be set to the item bound to that ItemTemplate.

Nigel Sampson
  • 10,549
  • 1
  • 28
  • 31