The xamDataCards™ control can lay out its cards horizontally or vertically similar to a WrapPanel container. The CardViewSettings object’s Orientation property is identical to the WrapPanel container’s Orientation property. If you set it to Horizontal, the xamDataCards control lays out its cards left-to-right then top-to-bottom. On the other hand, if you set it to Vertical, the xamDataCards control lays out its cards top-to-bottom then left-to-right. In either mode, the xamDataCards control will use all the space available to lay out its cards; however, you can limit the maximum number of rows or columns xamDataCards creates by setting the CardViewSettings object’s MaxCardRows or MaxCardCols properties, respectively. This effectively sets the maximum number of cards that your end users can view at one time.
The following example code demonstrates how to set the maximum number of viewable cards.
In XAML:
<igDP:XamDataCards Name="xamDataCards1" BindToSampleData="True"> <igDP:XamDataCards.ViewSettings> <!--A maximum of 8 cards in view--> <igDP:CardViewSettings MaxCardRows="2" MaxCardCols="4" /> </igDP:XamDataCards.ViewSettings> </igDP:XamDataCards>
In Visual Basic:
Me.xamDataCards1.ViewSettings.MaxCardRows = 2 Me.xamDataCards1.ViewSettings.MaxCardCols = 4
In C#:
this.xamDataCards1.ViewSettings.MaxCardRows = 2; this.xamDataCards1.ViewSettings.MaxCardCols = 4;