private void btnCatSearch_Click(object sender, EventArgs e) { ExpensePage expense = new ExpensePage(); expense.Activate(); expense.Show(); }
private void dataGrid_CellContentClick(object sender, DataGridViewCellEventArgs e) { var senderGrid = (DataGridView)sender; if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0) { var expId = expenseDataGrid.Rows[e.RowIndex].Cells[4].Value.ToString(); ExpenseDetails.ExpenseId = Convert.ToInt32(expId); this.Hide(); var expensePage = new ExpensePage(); expensePage.Activate(); expensePage.Show(); } }