Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7432843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:31:20+00:00 2026-05-29T09:31:20+00:00

I have a ModalPopupExtender which is, among other things, populated with a gridview (From

  • 0

I have a ModalPopupExtender which is, among other things, populated with a gridview (From a DataTable).

In this GridView I have a deletebutton attached to each row, which is supposed to delete the row. Is it anyway possible to delete the selected row from the datatable, and then update the GridView without closing the ModalPopupExtender?

Here is my GridView:

<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" PopupDragHandleControlID="divPopupReport"  TargetControlID="btnHidden" PopupControlID="divPopupReport" CancelControlID="btnCloseReport" BackgroundCssClass="modalBackground"></ajaxToolkit:ModalPopupExtender>
<asp:UpdatePanel runat="server" ID="upReport">
<ContentTemplate>
<div id="divPopupReport" runat="server" style="text-align:left; padding-right:0px; background-color:White; border: 2px solid #87d000; display:none;" >

<asp:GridView ID="GridView2" runat="server" CssClass="list listExtended" 
                        DataKeyNames="DocumentGuid" Width="100%" OnRowCommand="GridView2_RowCommand" AutoGenerateColumns="false">
                        <Columns>
                            <asp:BoundField DataField="DocumentName" HeaderText="Dokumentname">
                                <ItemStyle CssClass="list"></ItemStyle>
                            </asp:BoundField>
                            <asp:BoundField DataField="CardName" HeaderText="Reference">
                                <ItemStyle CssClass="list"></ItemStyle>
                            </asp:BoundField>
                            <asp:BoundField DataField="DocumentDate" HeaderText="Date">
                                <ItemStyle CssClass="list"></ItemStyle>
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="">
                                <ItemStyle CssClass="list" />
                                <ItemTemplate>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="">
                                <ItemStyle CssClass="list" />
                                <ItemTemplate>
                                    <asp:ImageButton ID="btnDelete" CssClass="image" runat="server" CommandName="Delete" CommandArgument='<%# Eval("DocumentGuid") %>' ImageUrl="~/delete.gif" Width="16" Height="16" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
</div>    
</ContentTemplate>
</asp:UpdatePanel>

And below my RowCommand.

protected void GridView2_RowCommand(object sender, GridViewCommandEventArgs e)
{
    if (e.CommandName == "Delete")
    {
        DataTable SelectedDataTable = Session["SelectedDataTable"] as DataTable;
        string guid = Convert.ToString(e.CommandArgument);
        DataRow[] dr = SelectedDataTable.Select("DocumentGuid = '" + guid + "'");
        SelectedDataTable.Rows.Remove(dr[0]);
        Session["SelectedDataTable"] = SelectedDataTable;
        GridView2.DataSource = SelectedDataTable;
        GridView2.DataBind();
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:31:21+00:00Added an answer on May 29, 2026 at 9:31 am

    Swap upReport panel with divPopupReport div (i.e. place upReport UpdatePanel into divPopupReport div).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a GridView which has a RowCommand event that opens a modalpopupextender on
Okay, so I have this page, which has one Ajax:AsyncFileUploader also some other ajax
I have ModalPopupExtender that contains a UserControl that basically consists of a GridView and
I have this modalPopupExtender, I want it to show a CheckBoxList with some data.
I have this page where in i have a ModalPopupExtender. Now the panel that
I have a gridview inside a ModalPopUpExtender, the grid view have the button add
I've got a page where I have a ModalPopUpExtender which I want to show
I have a ModalPopupExtender(mpe) which will show when a asp:button is clicked. The button
I have a ModalPopupExtender control and a panel which contains a iframe. The ModalPopupExtender's
I have an ASP panel with a modalpopupextender attached to it that is shown

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.