Well that was silly... Sometimes the "Submit Reply" button is just too close to this reply textbox. Accidently submitted before I finished my reply.
In the ItemDataBound handler for the datagrid, you can drill down to the individual controls in each item (e.Item, which is the grid row). You'll know the column number of your buttun column so you can directly access that delete button:
e.Item.Cells(x).Controls(0)
Convert that to a Button object, then you can add an attribute for onClick to it:
CType(e.Item.Cells(x).Controls(0), Button).Attributes("onClick") = ...
Put your confirm javascript in there, and you'll get a confirmation prompt for each delete button in the grid.
Note that you need to test e.Item.ItemType for AlternateItem or Item because that handler gets called for all items including the header, footer and pager and those won't have the delete button.
-
Peter