Results 1 to 2 of 2

Thread: delete confirmation box [RESOLVED]

  1. #1

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075

    delete confirmation box [RESOLVED]

    I have a datagrid with a delete button inside. I'm trying to get a confirmation box to show when the button is clicked, but instead I'm getting this error.

    Specified argument was out of the range of valid values. Parameter name: index

    Select Case e.Item.ItemType
    Case ListItemType.Item, ListItemType.AlternatingItem, ListItemType.EditItem
    Dim myTableCell As TableCell
    myTableCell = e.Item.Cells(4)
    Dim myDeleteButton As Button
    myDeleteButton = myTableCell.Controls(4)
    myDeleteButton.Attributes.Add("onclick", "return confirm('Are you Sure you want to delete this company?');")
    End Select

    is this the correct way to do this?
    Last edited by EyeTalion; Nov 20th, 2002 at 01:33 PM.

  2. #2

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    this works:

    Dim btnDelete As Button
    btnDelete = e.Item.Cells(4).Controls(0) '<---2nd column, first control
    btnDelete.Attributes.Add("onclick", "return confirm('Are you Sure you want to delete this row?');")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width