在datagrid_ItemDataBound 事件里面代码:
if ((e.Item.ItemType!=ListItemType.Footer)&&(e.Item.ItemType!=ListItemType.Header)&&(e.Item.ItemType!=ListItemType.Pager))
{
LinkButton ldeleterecord=(LinkButton)e.Item.Cells[10].Controls[0];
ldeleterecord.Attributes.Add("onclick","javascript:return confirm('you will delete?');");
}
cell[10] 时delete 链接的位置