Skip to main content
Tab

CardViewCommandLayoutItem.ShowSelectCheckbox Property

Specifies whether the Select Check Box command item is displayed in the command layout item.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v22.1.dll

Declaration

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

Property Value

Type Default Description
Boolean

false

true, if the check box is visible; otherwise, false.

Example

The following example uses an external check box to change the visibility of ASPxCardView check boxes in multi-selection mode.

View Example

<dx:ASPxCheckBox ID="chkDisabled" runat="server" Text="Disable selection checkboxes"
    AutoPostBack="true" />

<dx:ASPxCardView ID="ASPxCardView1" runat="server" DataSourceID="AccessDataSource1" KeyFieldName="CustomerID" OnCommandButtonInitialize="ASPxCardView1_CommandButtonInitialize" AutoGenerateColumns="False">
    <Columns>
        <dx:CardViewTextColumn FieldName="CompanyName" VisibleIndex="1">
        </dx:CardViewTextColumn>
        <dx:CardViewTextColumn FieldName="ContactName" VisibleIndex="2">
        </dx:CardViewTextColumn>
        <dx:CardViewTextColumn FieldName="City" VisibleIndex="5">
        </dx:CardViewTextColumn>
        <dx:CardViewTextColumn FieldName="Region" VisibleIndex="6">
        </dx:CardViewTextColumn>
        <dx:CardViewTextColumn FieldName="Country" VisibleIndex="8">
        </dx:CardViewTextColumn>
    </Columns>
    <CardLayoutProperties>
        <Items>
            <dx:CardViewCommandLayoutItem HorizontalAlign="Right" ShowSelectCheckbox="True">
            </dx:CardViewCommandLayoutItem>
            <dx:CardViewColumnLayoutItem ColumnName="Company Name">
            </dx:CardViewColumnLayoutItem>
            <dx:CardViewColumnLayoutItem ColumnName="Contact Name">
            </dx:CardViewColumnLayoutItem>
            <dx:CardViewColumnLayoutItem ColumnName="City">
            </dx:CardViewColumnLayoutItem>
            <dx:CardViewColumnLayoutItem ColumnName="Region">
            </dx:CardViewColumnLayoutItem>
            <dx:CardViewColumnLayoutItem ColumnName="Country">
            </dx:CardViewColumnLayoutItem>
            <dx:EditModeCommandLayoutItem HorizontalAlign="Right">
            </dx:EditModeCommandLayoutItem>
        </Items>
    </CardLayoutProperties>
    </dx:ASPxCardView>  
<br />
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/nwind.mdb"
    SelectCommand="SELECT * FROM [Customers]" />  
using System;
using DevExpress.Web;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e) {

    }
    protected void ASPxCardView1_CommandButtonInitialize(object sender, DevExpress.Web.ASPxCardViewCommandButtonEventArgs e) {
        if (e.ButtonType == CardViewCommandButtonType.SelectCheckbox)
            e.Visible = !chkDisabled.Checked;
    }
}
See Also