Hi,
I want to popup a dialog box to the user before delete the row in datagrid. I get some code from the internet, it was using "template column" to do the delete command. However, I was using "button column" instead of the previous one.
This is the code get from Internet:
Public Sub DataGrid1_ItemDataBound(ByVal s As Object, ByVal e As DataGridItemEventArgs)
Dim l As LinkButton
If e.Item.ItemType = ListItemType.EditItem Or e.Item.ItemType = ListItemType.AlternatingItem Then
l = CType(e.Item.Cells(1).FindControl("btnDelete"), LinkButton)
l.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');")
End Sub
My Problem is:
In my "Delete" button column, the link button text has been replaced by image path. So, how can I get control to the link button?
Thank for any help and suggestion.
Calvin
I want to popup a dialog box to the user before delete the row in datagrid. I get some code from the internet, it was using "template column" to do the delete command. However, I was using "button column" instead of the previous one.
This is the code get from Internet:
Public Sub DataGrid1_ItemDataBound(ByVal s As Object, ByVal e As DataGridItemEventArgs)
Dim l As LinkButton
If e.Item.ItemType = ListItemType.EditItem Or e.Item.ItemType = ListItemType.AlternatingItem Then
l = CType(e.Item.Cells(1).FindControl("btnDelete"), LinkButton)
l.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');")
End Sub
My Problem is:
In my "Delete" button column, the link button text has been replaced by image path. So, how can I get control to the link button?
Thank for any help and suggestion.
Calvin