How to Enable Touchscreen Scrolling in WPF CardView?
This article explains how to enable touchscreen swipe‑based scrolling in the CardView control for WPF applications.
By default, the CardView uses scrollbars or navigation buttons to move between cards. On touch-enabled devices, this may feel less intuitive. To support natural touch gestures such as swiping, you can wrap the CardView inside a ScrollViewer and enable panning using the PanningMode property.
PanningMode supports several options, including:
- None
- HorizontalOnly
- VerticalOnly
- Both
- HorizontalFirst
- VerticalFirst
This example enables two‑direction scrolling using touch:
<ScrollViewer PanningMode="Both"
VerticalScrollBarVisibility="Hidden" >
<StackPanel Margin="10">
<syncfusion:CardView>
<syncfusion:CardViewItem Header="Card 1">
<TextBlock Text="This is the first card." Margin="10"/>
</syncfusion:CardViewItem>
<syncfusion:CardViewItem Header="Card 2">
<TextBlock Text="This is the second card." Margin="10"/>
</syncfusion:CardViewItem>
<syncfusion:CardViewItem Header="Card 3">
<TextBlock Text="This is the third card." Margin="10"/>
</syncfusion:CardViewItem>
<syncfusion:CardViewItem Header="Card 4">
<TextBlock Text="This is the fourth card." Margin="10"/>
</syncfusion:CardViewItem>
<syncfusion:CardViewItem Header="Card 5">
<TextBlock Text="This is the fifth card." Margin="10"/>
</syncfusion:CardViewItem>
<syncfusion:CardViewItem Header="Card 6">
<TextBlock Text="This is the sixth card." Margin="10"/>
</syncfusion:CardViewItem>
<syncfusion:CardViewItem Header="Card 7">
<TextBlock Text="This is the seventh card." Margin="10"/>
</syncfusion:CardViewItem>
<syncfusion:CardViewItem Header="Card 8">
<TextBlock Text="This is the eighth card." Margin="10"/>
</syncfusion:CardViewItem>
<syncfusion:CardViewItem Header="Card 9">
<TextBlock Text="This is the ninth card." Margin="10"/>
</syncfusion:CardViewItem>
<syncfusion:CardViewItem Header="Card 10">
<TextBlock Text="This is the tenth card." Margin="10"/>
</syncfusion:CardViewItem>
</syncfusion:CardView>
</StackPanel>
</ScrollViewer>
Output:
Conclusion
I hope you enjoyed learning how to enable touchscreen scrolling in WPF CardView.
You can refer to our WPF CardView. feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started with configuration specifications. You can also explore our WPF CardView example to understand how to create and manipulate data.
For current customers, check out our components from the License and Downloads page. If you are new to Syncfusion, try our 30-day free trial to check out our other controls.
Please let us know in the comments section if you have any queries or require clarification. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!