In this example, the ASPxGridView control contains a custom Delete button.
<dx:GridViewCommandColumn ShowNewButtonInHeader="true" ShowEditButton="true">
<CustomButtons>
<dx:GridViewCommandColumnCustomButton ID="deleteButton" Text="Delete" />
</CustomButtons>
</dx:GridViewCommandColumn>
The client CustomButtonClick event handler shows ASPxPopupControl when a user clicks the Delete button.
function OnCustomButtonClick(s, e) {
visibleIndex = e.visibleIndex;
popup.Show();
}
<dx:ASPxPopupControl ID="ASPxPopupControl1" runat="server" Text="Are you sure?" ClientInstanceName="popup">
<ContentCollection>
<dx:PopupControlContentControl>
<dx:ASPxButton ID="yesButton" runat="server" Text="Yes" AutoPostBack="false">
<ClientSideEvents Click="OnClickYes" />
</dx:ASPxButton>
<dx:ASPxButton ID="noButton" runat="server" Text="No" AutoPostBack="false">
<ClientSideEvents Click="OnClickNo" />
</dx:ASPxButton>
</dx:PopupControlContentControl>
</ContentCollection>
</dx:ASPxPopupControl>
When a user clicks the Yes button, the Click event handler calls the DeleteRow method.
function OnClickYes(s, e) {
grid.DeleteRow(visibleIndex);
popup.Hide();
}
function OnClickNo(s, e) {
popup.Hide();
}
- Default.aspx (VB: Default.aspx)
- GridView for MVC - How to show a confirmation dialog using PopupControl
- Popup Control for Web Forms - How to implement a delete confirm dialog with a "Don't ask me again" option
(you will be redirected to DevExpress.com to submit your response)