Back to Devexpress

GridViewCommandColumn.ShowSelectCheckbox Property

aspnet-devexpress-dot-web-dot-gridviewcommandcolumn-3f5d8b81.md

latest4.6 KB
Original Source

GridViewCommandColumn.ShowSelectCheckbox Property

Specifies whether the control displays an editor (check box or radio button) for row selection.

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 to enable the check box selection mode; otherwise, false.

|

Remarks

Set the ShowSelectCheckbox property to true to enable the check box selection mode. The AllowSelectSingleRowOnly property defines the editor type (check box or radio button) that the control dispalys within command column cells.

When row selection changes, the control raises the server-side ASPxGridBase.SelectionChanged or the client-side ASPxClientGridView.SelectionChanged event (based on the ProcessSelectionChangedOnServer property value).

When cell merge is enabled, ASPxGridView does not support row selection.

Example

Web Forms

Run Demo: ASPxGridView - Row Selection (Web Forms)

aspx
<dx:ASPxGridView ID="grid" runat="server" KeyFieldName="CustomerID" AutoGenerateColumns="false">
    <Columns>
        <dx:GridViewCommandColumn ShowSelectCheckbox="true" />
        <%--...--%>
    </Columns>
</dx:ASPxGridView>

MVC

Run Demo: GridView - Row Selection (MVC)

csharp
@Html.DevExpress().GridView(settings => {
    settings.Name = "gvRowSelection";

    settings.KeyFieldName = "CustomerID";
    settings.CommandColumn.Visible = true;
    settings.CommandColumn.ShowSelectCheckbox = true;
    ...
}).Bind(Model).GetHtml()

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ShowSelectCheckbox property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

xaf-how-to-display-an-enumeration-property-as-a-drop-down-box-with-check-boxes/CS/E689.Module.Web/Editors/ASPxEnumPropertyEditorEx.cs#L46

csharp
GridViewCommandColumn selectionColumn = new GridViewCommandColumn();
selectionColumn.ShowSelectCheckbox = true;
lookupEdit.Columns.Add(selectionColumn);

xaf-how-to-display-an-enumeration-property-as-a-drop-down-box-with-check-boxes/VB/E689.Module.Web/Editors/ASPxEnumPropertyEditorEx.vb#L45

vb
Dim selectionColumn As New GridViewCommandColumn()
selectionColumn.ShowSelectCheckbox = True
lookupEdit.Columns.Add(selectionColumn)

See Also

GridViewCommandColumn Class

GridViewCommandColumn Members

DevExpress.Web Namespace