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 3390690
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:43:14+00:00 2026-05-18T03:43:14+00:00

I have a GridView and a SqlDataSource, which I have set to automatically generate

  • 0

I have a GridView and a SqlDataSource, which I have set to automatically generate Delete/Insert/Update statements. I then just enabled Deleting on the GridView, and usually away I’d go. For some reason though, the row is not being deleted – the page is posting back but the row is still there. When Delete is clicked, RowDeleting does fire though.

What possible causes could this be?

Edit: SELECT command:

SELECT id, templatename, CASE WHEN type = 'W' THEN 'Weekly' WHEN type = 'M' THEN 'Monthly' WHEN type = 'Q' THEN 'Quarterly' WHEN type = 'S' THEN 'Six-monthly' WHEN type = 'A' THEN 'Anually' END AS TypeText, CASE WHEN invorcred = 'I' THEN 'Invoice' WHEN invorcred = 'C' THEN 'Credit' END AS 'InvOrCredText', nextinvdate, lastinvdate FROM InvoiceTemplates WHERE (sageaccount = @sageaccount)
  • 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-18T03:43:15+00:00Added an answer on May 18, 2026 at 3:43 am

    Try to write in the RowDeleting event instead of auto generated, maybe because you need to get the id of the row you want to delete (Where clause)

    Example:
    Label13 is Hidden, I get it from select statement but I don’t show it the user.
    VB.NET:

        Protected Sub gvAddresses_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles gvAddresses.RowDeleting
    
            Dim selectedAddessId As Label = gvAddresses.Rows(e.RowIndex).FindControl("Label13")
            SqlDataSource.DeleteParameters("add_id").DefaultValue = selectedAddessId.Text
            SqlDataSource.Delete()
    End Sub
    

    C#

        protected void gvAddresses_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e)
    {
        //Get the address Id to delete the selected address only
        Label selectedAddessId = gvAddresses.Rows(e.RowIndex).FindControl("Label13");
        SqlDataSource.DeleteParameters("add_id").DefaultValue = selectedAddessId.Text;
        SqlDataSource.Delete();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have GridView which I can select a row. I then have a button
I have a GridView in ASP.net which is filled from an SqlDataSource. one of
I have a Gridview boundfield where i set ReadOnly to true because i don't
If I bind GridView to SqlDataSource, then the first time page will be created,
I have a GridView which I am populating by calling a method to return
I have a gridview control in my c# program which currently has 12 columns
I have an ASP.NET GridView which displays a list of neighborhoods. I wish a
I have a griview which is bounded to a sqldatasource and changed dynamically. How
I have a GridView control in an Asp.net application, that has a <asp:buttonField> of
I have a GridView where one column is bound to an object property containing

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.