// -1 is used instead of 0 because the columns begin at zero. private int nDelete = -1; //private int nEdit = -1; protected override void OnItemDataBound(DataGridItemEventArgs e) { base.OnItemDataBound (e); // the header ultimately figures out where (which column) the delete column is if (this.nDelete == -1) //|| this.nEdit == -1) this.FindButtons(e); if (this.nDelete > -1) e.Item.Cells[this.nDelete].Attributes.Add("onclick", "if(confirm('Are you sure to delete?')){}else{return false}"); //if (this.nEdit > -1) // e.Item.Cells[this.nEdit].Attributes.Add("onclick", "alert('Edit Hello');"); } private void FindButtons(DataGridItemEventArgs e) { int i = 0; foreach (TableCell cell in e.Item.Cells) { if (cell.Text == "Delete") this.nDelete = i; //if (cell.Text == "Edit") // this.nEdit = i; i++; } }>How do I display a delete alert message from the delete button in a mmDataGrid?