Skip to content

Windows 8 GridView Cross-Swipe and Tap (multi-selection + single selection)

This is for getting a GridView to use the same drag-down = select,  tap = action interaction model that we see on the Windows 8 start screen.

In your GridView, create a copy of the default ItmeContainerStyle. You can do this by right clicking on the GridView in the designer space (or in the document tree) and selecting “Edit Additional Templates => Edit Generated Item Container (ItemContainerStyle) => Edit a Copy…”

GridView_ItemContainerStyle

In the generated ItemContainerStyle, delete the following property:

<Setter Property="IsHoldingEnabled" Value="True"/>

Then, change the following properties and add the event handlers on your GridView:

<GridView
   ItemContainerStyle="{StaticResource SwipeEnabledItemContainerStyle}"
   SelectionChanged="GridView_SelectionChanged"
   SelectionMode="Multiple"
   ItemClick="GridView_ItemClicked"
   IsItemClickEnabled="True" >