Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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? :confused:

 

Thank for any help and suggestion. :)

 

Calvin

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...