private void btnNew_Click(object sender, EventArgs e) { frmExpenseCategoryEdit frm = new frmExpenseCategoryEdit() { Mode = Models.EntryMode.New, expenseId = 0 }; if (frm.ShowDialog() == DialogResult.Yes) { BindGrid(); } }
private void grdExpenseMaster_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { var senderGrid = (DataGridView)sender; if (e.RowIndex >= 0) { var id = Convert.ToInt64(senderGrid.Rows[e.RowIndex].Cells[1].Value); frmExpenseCategoryEdit frm = new frmExpenseCategoryEdit() { Mode = Models.EntryMode.Edit, expenseId = id }; if (frm.ShowDialog() == DialogResult.Yes) { BindGrid(); } } }