Back to Devexpress

CardViewCommandLayoutItem.ShowSelectCheckbox Property

aspnet-devexpress-dot-web-dot-cardviewcommandlayoutitem-babf9ef1.md

latest3.5 KB
Original Source

CardViewCommandLayoutItem.ShowSelectCheckbox Property

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

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue(false)]
public bool ShowSelectCheckbox { get; set; }
vb
<DefaultValue(False)>
Public Property ShowSelectCheckbox As Boolean

Property Value

TypeDefaultDescription
Booleanfalse

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.

aspx
<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" />
        <dx:CardViewTextColumn FieldName="ContactName" />
        <dx:CardViewTextColumn FieldName="City" />
        <dx:CardViewTextColumn FieldName="Region" />
        <dx:CardViewTextColumn FieldName="Country" />
    </Columns>
    <CardLayoutProperties>
        <Items>
            <dx:CardViewCommandLayoutItem HorizontalAlign="Right" ShowSelectCheckbox="True" />
            <dx:CardViewColumnLayoutItem ColumnName="Company Name" />
            <dx:CardViewColumnLayoutItem ColumnName="Contact Name" />
            <dx:CardViewColumnLayoutItem ColumnName="City" />
            <dx:CardViewColumnLayoutItem ColumnName="Region" />
            <dx:CardViewColumnLayoutItem ColumnName="Country" />
            <dx:EditModeCommandLayoutItem HorizontalAlign="Right" />
        </Items>
    </CardLayoutProperties>
</dx:ASPxCardView>  
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/nwind.mdb"
    SelectCommand="SELECT * FROM [Customers]" />
csharp
protected void ASPxCardView1_CommandButtonInitialize(object sender, DevExpress.Web.ASPxCardViewCommandButtonEventArgs e) {
    if (e.ButtonType == CardViewCommandButtonType.SelectCheckbox)
        e.Visible = !chkDisabled.Checked;
}
vb
Protected Sub ASPxCardView1_CommandButtonInitialize(ByVal sender As Object, ByVal e As DevExpress.Web.ASPxCardViewCommandButtonEventArgs)
    If e.ButtonType = CardViewCommandButtonType.SelectCheckbox Then
        e.Visible = Not chkDisabled.Checked
    End If
End Sub

See Also

ShowSelectButton

CardViewCommandLayoutItem Class

CardViewCommandLayoutItem Members

DevExpress.Web Namespace