Skip to content

DevExpress-Examples/asp-net-web-forms-gridview-confirmation-dialog-with-aspxpopupcontrol

Repository files navigation

GridView for Web Forms - How to use ASPxPopupControl to show a confirmation dialog

Grid View - Confirmation message

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();
}

Files to Look At

More Examples

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

About

Use ASPxPopupControl to show a confirmation dialog.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •