delete command for listview control

mugsey
mugsey used Ask the Experts™
on
I have a listview that displays a set of images with each image having a delete button.
The datakey set on the listview is ID which is of type GUID.

In the code below I want to get the ID of the image (guid) to enable it to be passed to delete method.
What else do I need to doI
protected void ImageList_ItemCommand(object sender, ListViewCommandEventArgs e)
    {
        if (String.Equals(e.CommandName, "Delete"))
        {
            ListViewDataItem dataItem = (ListViewDataItem)e.Item;
           
        }
    }

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Is this what you mean?
datakey = (int)YourListView.DataKeys[e.Item.ItemIndex];

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial