Back to Devexpress

ASPxGridViewBehaviorSettings.AllowSelectByRowClick Property

aspnet-devexpress-dot-web-dot-aspxgridviewbehaviorsettings-7f77674c.md

latest4.8 KB
Original Source

ASPxGridViewBehaviorSettings.AllowSelectByRowClick Property

Specifies whether row click selection is enabled.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

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

Property Value

TypeDefaultDescription
Booleanfalse

true to enable row click selection; otherwise, false.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to AllowSelectByRowClick
ASPxGridView

.SettingsBehavior .AllowSelectByRowClick

| | GridViewProperties |

.SettingsBehavior .AllowSelectByRowClick

|

Remarks

Set the AllowSelectByRowClick property to true to enable row click selection. A new row click clears the previous selection and selects the current row.

ASPxGridView supports multiple row selection. A user can select multiple rows as follows:

  • Hold down the Ctrl key and click the rows.
  • Click the first row, hold down the Shift key, and click the last row.

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).

Run Demo: ASPxGridView - Use Row Clicks

aspx
<dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" KeyFieldName="EmployeeID">
    <SettingsBehavior AllowSelectByRowClick="true"/>
    <Columns>
        <%--...--%>
    </Columns>
</dx:ASPxGridView>

Limitations

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the AllowSelectByRowClick 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.

asp-net-web-forms-grid-get-column-values-of-multiple-selected-rows/CS/GetSelectedValuesAllColumns/Default.aspx.cs#L19

csharp
ASPxGridView1.KeyFieldName = "ID";
ASPxGridView1.SettingsBehavior.AllowSelectByRowClick = true;
ASPxGridView1.DataBind();

asp-net-web-forms-grid-get-column-values-of-multiple-selected-rows/VB/GetSelectedValuesAllColumns/Default.aspx.vb#L21

vb
ASPxGridView1.KeyFieldName = "ID"
ASPxGridView1.SettingsBehavior.AllowSelectByRowClick = True
ASPxGridView1.DataBind()

See Also

ASPxGridViewBehaviorSettings Class

ASPxGridViewBehaviorSettings Members

DevExpress.Web Namespace