If your declaritive code in the .ascx is the same as you've postes, the grdUserRoles_Delete sub should be called whenever the "Delete" image button is clicked. Be sure that:
1. In the datagrid control markup the attribute setting ondeletecommand="grdUserRoles_Delete" correctly refers to name of the subroutine that handles the delete.
2. In the "Delete" image button the attribute setting commandname="Delete" has not been changed to a different comand name. It must be "Delete" for the event linkage to work.
If you are not able to get the event linkage to work this way, you could remove the ondeletecommand="grdUserRoles_Delete" from the datagrid control markup and change the delete event handler declaration to:
Public Sub grdUserRoles_Delete(ByVal sender As Object, ByVal e As DataGridCommandEventArgs) Handles grdUserRoles.DeleteCommand
I've had some problems with loosing event handler linkage when VS2003/ASP.NET 1.1 codebehinds are converted to VS2005/ASP.NET 2.0 codefiles and their Partial Class design.
As for your other questions:
In securityroles.ascx.vb, the grdUserRoles_ItemCreated handler adds (using the ClientAPI) an onclick attribute that will raise a javascript confirm box. If you are doing likewise, are you seeing the confirm box appear when the Delete image button is clicked?
In the grdUserRoles_Delete handler in securityroles.ascx.vb, the RoleId or UserId (depending on whether the datagrid is displaying roles or users) is obtained from the datagrid's DataKeys collection using the index passed to the subroutine in the e parameter which is of class DataGridCommandEventArgs:
grdUserRoles.DataKeys(e.Item.ItemIndex)