ASPxCardViewCommandButtonEventArgs.ButtonType Property
Gets the type of the command button currently being initialized.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v22.2.dll
NuGet Package: DevExpress.Web
Declaration
Property Value
Type | Description |
---|---|
CardViewCommandButtonType | One of the ColumnCommandButtonType enumeration values. |
Available values:
Name | Description |
---|---|
Edit | Corresponds to the Edit command. Switches the ASPxCardView to edit mode. |
New | Corresponds to the New command. Creates a new card. |
Delete | Corresponds to the Delete command. Deletes the current card. |
Select | Corresponds to the Select command. Selects/deselects cards. |
Update | Corresponds to the Update command. Saves all the changes made to the current card and switches the ASPxCardView to browse mode. |
Cancel | Corresponds to the Cancel command. Discards any changes made to the current card and switches the ASPxCardView to browse mode. |
UpdateSummaries | Corresponds to the Update summaries command. Recalculates total and group summaries when a user increases a cell value that was equal to the calculated minimum or decreases a value that was equal to the calculated maximum. |
SelectCheckbox | Corresponds to the Select command initiated via a select check box or radio button. Selects/deselects cards. |
ApplySearchPanelFilter | Corresponds to the Apply command. Applies the filter specified in the search panel. |
ClearSearchPanelFilter | Corresponds to the Clear command. Clears the filter specified in the search panel. |
EndlessPagingShowMoreCards | Corresponds to the Show more cards link. Loads cards on demand when endless paging is enabled. |
Recover | Corresponds to the Recover command. Recovers the deleted cards. |
Example
The following example uses an external check box to change the visibility of ASPxCardView check boxes in multi-selection mode.
<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;
}
}