Skip to main content

ASPxCardView.Selection Property

Gets the ASPxCardView’s selection.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v22.2.dll

NuGet Package: DevExpress.Web


public CardViewSelection Selection { get; }

Property Value

Type Description

A CardViewSelection object that represents the ASPxCardView’s selection.


The ASPxCardView allows multiple card to be selected. The object returned by the Selection property provides methods that allow you to select and deselect individual cards, or all cards, obtain the number of selected cards, etc. End-users can select/deselect cards by using the Select command item (the CardViewCommandLayoutItem.ShowSelectButton property) or by a check box (the CardViewCommandLayoutItem.ShowSelectCheckbox property). Use the ASPxCardViewBehaviorSettings.AllowSelectSingleCardOnly property to specify whether multiple card selection is available within the ASPxCardView.


The style settings used to paint selected cards can be accessed via the CardViewStyles.SelectedCard property.

To respond to changing selection, handle the ASPxGridBase.SelectionChanged event.


The following example selects customers who live in the specified country.

When an end user types the country into the search box and clicks Search, the button editor’s ButtonClick event is handled to call the ASPxClientCardView.PerformCallback method.

This sends a callback to the server and generates the ASPxCardView.CustomCallback event, which passes the “Country” value entered by the user. The CustomCallback event is handled to select the customers who live in the specified country.

protected void ASPxCardView2_CustomCallback(object sender, ASPxCardViewCustomCallbackEventArgs e)
string country = e.Parameters.ToString();
for (int i = 0; i < ASPxCardView2.VisibleCardCount; i++)
    if (ASPxCardView2.GetCardValues(i, "Country") != null)
        if (ASPxCardView2.GetCardValues(i, "Country").ToString() == country)
See Also