Skip to main content

CardView.CardTemplate Property

Gets or sets a template that defines the appearance of cards. This is a dependency property.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v23.2.dll

NuGet Package: DevExpress.Wpf.Grid.Core


public DataTemplate CardTemplate { get; set; }

Property Value

Type Description

Defines the appearance of cards.


Elements in the CardTemplate specify the appearance of CardData objects. An object’s Row property contains the underlying data item. To bind to data item properties, the path should look as follows: "{Binding Row.YourDataSourceProperty}".


The example uses a card template to change the appearance of cards.

WPF Data Grid - Card Template

Run Demo: WPF Data Grid - Card View Custom Templates

                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            <dxe:ImageEdit Grid.Column="0" Source="{Binding Path=Row.ImageData}"/>
            <StackPanel Orientation="Vertical" VerticalAlignment="Top" Margin="12,0,12,0" Grid.Column="1">
                <StackPanel Orientation="Horizontal" Margin="0,0,0,4">
                    <TextBlock FontWeight="Bold" Text="Title: "/>
                    <TextBlock Text="{Binding Path=Row.JobTitle}"/>
                <StackPanel Orientation="Horizontal" Margin="0,0,0,4">
                    <TextBlock FontWeight="Bold" Text="First Name: "/>
                    <TextBlock Text="{Binding Path=Row.FirstName}"/>
                <StackPanel Orientation="Horizontal">
                    <TextBlock FontWeight="Bold" Text="Last Name: "/>
                    <TextBlock Text="{Binding Path=Row.LastName}"/>
            <!-- ... -->
See Also