ASPxCardViewCommandButtonEventArgs.ButtonType Property
Gets the type of the command button currently being initialized.
Namespace: DevExpress.Web
Assembly:
DevExpress.Web.v20.2.dll
NuGet Package:
DevExpress.Web
Declaration
public CardViewCommandButtonType ButtonType { get; }
Public ReadOnly Property ButtonType As CardViewCommandButtonType
Property Value
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.
View Example
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;
}
}
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="DevExpress.Web.v15.1, Version=15.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>How to change the visibility of check boxes in multi-selection mode</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<dx:ASPxCheckBox ID="chkDisabled" runat="server" Text="Disable selection checkboxes"
AutoPostBack="true" />
<br />
<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]" />
</div>
</form>
</body>
</html>
Imports System
Imports DevExpress.Web
Partial Public Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
End Sub
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
End Class
<%@ Page Language="vb" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<%@ Register Assembly="DevExpress.Web.v15.1, Version=15.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>How to change the visibility of check boxes in multi-selection mode</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<dx:ASPxCheckBox ID="chkDisabled" runat="server" Text="Disable selection checkboxes"
AutoPostBack="true" />
<br />
<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]" />
</div>
</form>
</body>
</html>
See Also