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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:57:23+00:00 2026-05-27T12:57:23+00:00

I have a ListView and I have set up my Delete Link button. When

  • 0

I have a ListView and I have set up my Delete Link button. When I clicked Delete however I get "The ListView 'ListView' raised event ItemDeleting which wasn't handled." So I decided to try and implement the DeleteLinkButton_Click() and ListView_ItemDeleted() … however I can’t figure out how to identify which row I’ve selected for my DeleteLinkButton_Click().

I didn’t bind my source through a control instead I used the following method.

ListView.DataSource = myObject.RetreiveInfo()
ListView.DataBind()

I figure if I can identify my row I can access the values of the labels there and pass them to a stored procedure and perform my DELETE.

Can anyone help? If I need to provide more code just let me know!

Edit:

CodeBehind

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
   If Not IsPostBack Then
      UpdateDisplay()
   End If
End Sub

Protected Sub UpdateDistplay()
    ListView.DataSource = myObject.RetrieveInfo()
    ListView.DataBind()
End Sub

ASPX Page

<ItemTemplate>
  <tr>
      <td>
         <asp:LinkButton ID="DeleteLinkButton" Text="Delete" CommandName="Delete" OnClientClick="return confirm('Delete this Info?')" runat="server"></asp:LinkButton>
      </td>
      <td>
         <asp:Label ID="Name" runat="server" Text='<%# Bind("Name") %>'></asp:Label>
      </td>
  </tr>
</ItemTemplate>
  • 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-27T12:57:24+00:00Added an answer on May 27, 2026 at 12:57 pm

    You can find out the index of the item being deleted in the ItemDeleting event, so handling that first might help you out a bit more. It looks like this:

    Protected Sub myListView_OnItemDeleting(ByVal sender As Object, ByVal e As ListViewDeleteEventArgs)
        Dim deletedIndex As Integer
        deletedIndex = e.ItemIndex
    End Sub
    

    At this point, you now have the index of the item whose delete button was clicked, so you can look up the label and perform the DELETE (as you mentioned in your question).

    Good luck!

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

Sidebar

Related Questions

In my application, I have ListView which is set by my CustomAdapter (i.e. ArrayAdapter).
I have a ListView control set up in details mode with 5 columns. It
I have a ListView that is set up with a MinHeight and a MaxHeight.
I have a listview of width set to Auto. When I run the windows
I have a ListView control on my form set up like this in details
I have the following problem. The background color in a ListView is set LightGreen
I have an empty TextView set for my ListView . When there is no
I have a listview which includes 2 textviews and 1 imageview. Now, the image
I have a ListView that has a FileUpload control and a button in each
I have a ListView (set to CHOICE_MODE_SINGLE) I have a SimpleCursorAdapter who fill my

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.