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
See Also