private void main_ultraGrid_ClickCellButton(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e) { int detailID = (int)e.Cell.Row.Cells[Form_task21_sec.ID_colName].Value; if (e.Cell.Value.Equals(Form_task21_sec.edit_colName)) { Form_task21_detail detailForm = new Form_task21_detail(this.secID, detailID); this.Pop_detailForm(detailForm); } else if (e.Cell.Value.Equals(Form_task21_sec.del_colName)) { if (MessageBox.Show("Are you sure to Delete Task " + detailID + "?", "Msg", MessageBoxButtons.OKCancel) == DialogResult.OK) { Task21_security detail = new Task21_security(detailID); if (detail == null) { return; } detail.Delete_from_DB(); Task21_secMaster.Reset(); this.Refresh_parentUI(); this.BindData(); } } }
private void Pop_detailForm(Form_task21_detail detailForm) { detailForm.Refresh_UI = delegate() { this.Refresh_parentUI(); this.BindData(); }; detailForm.Show(); }
/******************************UI Event handlers**************************************/ private void add_button_Click(object sender, EventArgs e) { Form_task21_detail detailForm = new Form_task21_detail(this.secID); this.Pop_detailForm(detailForm); }