Do like below...
ImageButton bttn = new ImageButton();
bttn.CommandName = "Delete";
bttn.ImageUrl = "delete.png";
bttn.ToolTip = "Click to delete this record";
bttn.CommandArgument = e.Row.Cells[0].Text;
bttn.OnClientClick = "return confirm('Are you sure you to delete " + e.Row.Cells[0].Text + "?');";
bttn.Click += new ImageClickEventHandler(b_Click);
cell.Controls.Add(bttn);
e.Row.Cells.Add(cell);
Now, event would look like...
void b_Click(object sender, ImageClickEventArgs e)
{
}