private void btnNew_Click(object sender, EventArgs e) { frmExpenseEdit frm = new frmExpenseEdit(); if (frm.ShowDialog() == DialogResult.OK) { clearForm(); } }
private void grdExpense_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { var senderGrid = (DataGridView)sender; if (e.RowIndex >= 0) { var id = Convert.ToInt64(senderGrid.Rows[e.RowIndex].Cells[0].Value); if (id > 0) { frmExpenseEdit frm = new frmExpenseEdit() { Mode = Models.EntryMode.Edit, ExpenseId = id }; if (frm.ShowDialog() == DialogResult.OK) { bindGrid(); } } } }