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

  • SEARCH
  • Home
  • 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 6329081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:35:04+00:00 2026-05-24T17:35:04+00:00

<asp:UpdatePanel ID=UpdatePanel10 runat=server> <ContentTemplate> <center> <asp:GridView ID=gridInboxMessage runat=server AllowPaging=True AllowSorting=True AutoGenerateColumns=False DataSourceID=LinqDataSource1 OnSelectedIndexChanged=gridInboxMessage_SelectedIndexChanged onrowdeleted=gridInboxMessage_RowDeleted

  • 0
<asp:UpdatePanel ID="UpdatePanel10" runat="server">
        <ContentTemplate>
            <center>
                    <asp:GridView ID="gridInboxMessage" runat="server" AllowPaging="True"
                        AllowSorting="True" 
                        AutoGenerateColumns="False" DataSourceID="LinqDataSource1"                            OnSelectedIndexChanged="gridInboxMessage_SelectedIndexChanged"   
                        onrowdeleted="gridInboxMessage_RowDeleted" 
                        onrowdeleting="gridInboxMessage_RowDeleting">
                        <Columns>

                            <asp:CommandField ShowSelectButton="True"  SelectText="show text" />   

                           <asp:TemplateField >
                                <ItemTemplate>
                                    <asp:Button ID="btnDeleteInbox" Text="delete" OnClick="btnDeleteInbox_Click" runat="server" />
                                </ItemTemplate>
                            </asp:TemplateField>

                            <asp:BoundField DataField="Row" HeaderText="row" ReadOnly="True" SortExpression="Row" />

                            <asp:TemplateField SortExpression="Body" HeaderText="متن">
                                <ItemTemplate>
                                    <asp:Label ID="MyBody" runat="server" Text='<%# TruncateText(Eval("Body"))%>'>                            
                                    </asp:Label>
                                    <asp:Label ID="fullBodyRecieve" Visible="false" runat="server" Text='<%# Eval("Body")%>'>
                                    </asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>                               
                        </Columns>
                    </asp:GridView>

                    <asp:LinqDataSource  ID="LinqDataSource1" AutoSort="true" 
                         runat="server" ContextTypeName="DataClassesDataContext"
                        Select="new (Row,Title, Body, Sender, Date1)" TableName="PrivateMessages" 
                        Where="Receptor == @Receptor" ondeleted="LinqDataSource1_Deleted" 
                        ondeleting="LinqDataSource1_Deleting">
                        <WhereParameters>
                            <asp:QueryStringParameter Name="Receptor" QueryStringField="idCompany" Type="String" />
                        </WhereParameters>
                    </asp:LinqDataSource>
        </ContentTemplate>

    </asp:UpdatePanel>

 protected void btnDeleteInbox_Click(object sender, EventArgs e)
{
    GridViewRow row = gridInboxMessage.SelectedRow;
    var inboxMessage = (from b in dc.PrivateMessages where b.Row.ToString() ==     row.Cells[0].Text select b).Single();
    dc.PrivateMessages.DeleteOnSubmit(inboxMessage);
    dc.SubmitChanges();
}

btnDeleteInbox_Click doe not work??This method is never executed

protected void gridInboxMessage_RowDeleted(object sender, GridViewDeletedEventArgs e)
{
    GridViewRow row = gridInboxMessage.SelectedRow;
    var inboxMessage = (from b in dc.PrivateMessages where b.Row.ToString() == row.Cells[0].Text select b).Single();
    dc.PrivateMessages.DeleteOnSubmit(inboxMessage);
    dc.SubmitChanges();
}

gridInboxMessage_RowDeleted doe not work??This method is never executed

protected void gridInboxMessage_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
    GridViewRow row = gridInboxMessage.SelectedRow;
    var inboxMessage = (from b in dc.PrivateMessages where b.Row.ToString() == row.Cells[0].Text select b).Single();
    dc.PrivateMessages.DeleteOnSubmit(inboxMessage);
    dc.SubmitChanges();
}

gridInboxMessage_RowDeleting doe not work??This method is never executed

  • 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-24T17:35:06+00:00Added an answer on May 24, 2026 at 5:35 pm

    The RowDeleted and RowDeleting event handlers are probably not getting executed because it does not appear as though anything is calling the delete command. You’re not generating a delete button and your custom button is not calling the delete command. See the example in the RowDeleting event documentation for how to implement the use of the event. Notice that the example sets the “AutoGenerateDeleteButton” property to true. When they user clicks that button, the RowDeleting and then RowDeleted events will fire.

    I’m not sure why your custom button’s handler is not getting executed. Can you confirm that your page is indeed posting back? Are you able to debug through the code to see what steps it is taking during the postback? As Muhammad requested, will you please include your page load code as well as any other relevant code?

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

Sidebar

Related Questions

This is my situation: Page: <asp:UpdatePanel ID=updatePanel1 runat=server ChildrenAsTriggers=true> <ContentTemplate> ... <uc:ChildControl ID=ucChild runat=server
I have the following gridview that is inside an updatepanel: <asp:UpdatePanel ID=UpdatePanel1 runat=server> <ContentTemplate>
I've the following code: <asp:UpdatePanel runat=server ID=upanel1 > <ContentTemplate > <div id=west class=x-hide-display style=background-color:
I have an ASP.NET website containing the following <asp:UpdatePanel ID=UpdatePanel1 runat=server > <ContentTemplate> <asp:Label
I've got DropDownList in UpdatePanel as shown below: <asp:UpdatePanel ID=UpdatePanel1 runat=server> <ContentTemplate> <asp:DropDownList ID=DropDownList1
<asp:ScriptManager ID=ScriptManager1 runat=server/> <asp:UpdatePanel ID=UpdatePanel1 runat=server> <Triggers> <asp:AsyncPostBackTrigger ControlID=chkStaySignedIn EventName=Checked /> </Triggers> <ContentTemplate> <asp:Label
<asp:ScriptManager ID=ScriptManager1 runat=server> </asp:ScriptManager> <asp:UpdatePanel ID=UpdatePanel1 runat=server> <ContentTemplate> <p runat=server> <asp:Label ID=lblDOA runat=server Text=Appointment
<asp:ModalPopupExtender ID=MPE_EditGroup runat=server TargetControlID=btnShowPopup PopupControlID=pnlpopup DropShadow=true BackgroundCssClass=modalBackground /> <asp:Panel ID=pnlpopup runat=server > <asp:UpdatePanel ID=UpdatePanel1
I have the following really simple code <asp:ScriptManager ID=ScriptManager1 runat=server> </asp:ScriptManager> <asp:UpdatePanel ID=UpdatePanel1 runat=server>
I have a asp:ListBox wrapped inside an asp:UpdatePanel. The list box contains all the

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.