Skip to main content
Tab

ASPxCardViewBehaviorSettings.AllowSelectByCardClick Property

Gets or sets a value that specifies whether selection via card clicks is available within the ASPxCardView.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.2.dll

Declaration

[DefaultValue(false)]
public bool AllowSelectByCardClick { get; set; }

Property Value

Type Default Description
Boolean false

true if selection via card clicks is available; otherwise, false.

Property Paths

You can access this nested property as listed below:

Library Object Type Path to AllowSelectByCardClick
ASP.NET MVC Extensions CardViewSettings
.SettingsBehavior .AllowSelectByCardClick
ASP.NET Web Forms Controls ASPxCardView
.SettingsBehavior .AllowSelectByCardClick

Remarks

In addition to a command column’s check boxes, the ASPxCardView provides an easy way to select single or multiple cards simply by clicking them. To enable this mode, set the AllowSelectByCardClick property to true.

When the AllowSelectByCardClick is enabled, clicking any card clears the previous selection and selects this card.

To select multiple cards, click them while holding down the CTRL key. Clicking a card in this manner toggles its selected state and preserves the selection. To select contiguous cards, click the first card you want to select. Then, hold down the SHIFT key and click the last card. You can continue to customize the selection by clicking individual cards while holding down the CTRL key.

Note

Multiple card selection is available if the ASPxCardViewBehaviorSettings.AllowSelectSingleCardOnly property is disabled.

Example

Web Forms:

<dx:ASPxCardView ID="CardView" ClientInstanceName="cardView" runat="server" DataSourceID="EmployeesDataSource" Width="100%" KeyFieldName="EmployeeID" OnPreRender="CardView_PreRender">
    <ClientSideEvents SelectionChanged="OnCardSelectionChanged" />
    <SettingsBehavior AllowSelectByCardClick="true" />
    <SettingsPager>
        <SettingsTableLayout ColumnCount="2" RowsPerPage="2" />
    </SettingsPager>
    <CardLayoutProperties ColCount="2">
         <Items>
        ...
        </Items>
        <Styles LayoutItem-Caption-Font-Bold="true" />
    </CardLayoutProperties>
    <Columns>
        ....
    </Columns>
</dx:ASPxCardView>

MVC:

@Html.DevExpress().CardView(
    settings => {
        settings.Name = "CardView";
        settings.CallbackRouteValues = new { Controller = "FocusingAndSelection", Action = "SelectionPartial" };

        settings.SettingsBehavior.AllowSelectByCardClick = true;
        ...
    }).Bind(Model).GetHtml()

CardView - AllowSelectByCardClick

Online Demos

See Also