|
-
Nov 20th, 2002, 09:33 AM
#1
Thread Starter
Frenzied Member
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.
-
Nov 20th, 2002, 01:33 PM
#2
Thread Starter
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|