Skip to main content

ASPxClientGridView.CustomButtonClick Event

Occurs when a user clicks a custom command button.

Declaration

CustomButtonClick: ASPxClientEvent<ASPxClientGridViewCustomButtonEventHandler<ASPxClientGridView>>

Event Data

The CustomButtonClick event's data class is ASPxClientGridViewCustomButtonEventArgs. The following properties provide information specific to this event:

Property Description
buttonID Gets the value that identifies the custom button.
processOnServer Specifies whether or not to process the event on the server. Inherited from ASPxClientProcessingModeEventArgs.
visibleIndex Gets the value that identifies the row whose custom button has been clicked.

Remarks

Handle the CustomButtonClick event to define an action for a custom button.

The event parameter’s ASPxClientGridViewCustomButtonEventArgs.buttonID property allows you to identify the clicked button. Set the ASPxClientProcessingModeEventArgs.processOnServer property to true to raise the ASPxGridView.CustomButtonCallback event that allows you to process a custom button click on the server.

<dx:ASPxGridView ID="ASPxGridView1" runat="server" ClientInstanceName="gridView"
    AutoGenerateColumns="false">
    <ClientSideEvents CustomButtonClick="OnCustomButtonClick" />
    <Columns>
        <dx:GridViewCommandColumn VisibleIndex="0" Width="100px">
            <CustomButtons>
                <dx:GridViewCommandColumnCustomButton Text="Show New Window" ID="ShowNewWindow" />
            </CustomButtons>
        </dx:GridViewCommandColumn>
        <%--...--%>
    </Columns>
</dx:ASPxGridView>
function OnCustomButtonClick(s, e) {
    if (e.buttonID != 'ShowNewWindow') return;
        rowVisibleIndex = e.visibleIndex;
        s.GetRowValues(e.visibleIndex, 'ID', ShowPopup);
}

function ShowPopup(Id) {
    // your code
}

Online Examples

View Example: How to specify a custom button action for particular grid rows

View Example: Show the Popup Control on the Grid's Custom Button Click

View Example: How to use ASPxPopupControl to show a confirmation dialog

View Example: Grid View for ASP.NET MVC - How to use a popup control to show a confirmation dialog box

View Example: Grid View for ASP.NET MVC - How to call an Action method on a custom button click

See Also