private void btnNew_Click(object sender, EventArgs e) { ChequeForm form = new ChequeForm(-1); form.initForm(); form.ShowDialog(); fillGrid(); }
private void showCheque(object sender, string index) { DataGridView gv = (DataGridView)sender; if (gv.SelectedCells.Count > 0) { DataGridViewColumn col = gv.Columns[gv.SelectedCells[0].ColumnIndex]; if (col.DataGridView.SelectedCells.Count > 0 && gv.SelectedCells[0].Selected) { DataGridViewRow dr = gv.SelectedCells[0].OwningRow; int id = -1; id = int.Parse(dr.Cells[ChequeEntity.FIELD_ID + index].Value.ToString()); ChequeForm form = new ChequeForm(id); form.readOnly = true; form.initForm(); form.ShowDialog(); } } }
private void dataGridView_DoubleClick(object sender, EventArgs e) { DataGridView gv = (DataGridView)sender; if (gv.SelectedCells.Count > 0) { DataGridViewColumn col = gv.Columns[gv.SelectedCells[0].ColumnIndex]; if (col.DataGridView.SelectedCells.Count > 0 && gv.SelectedCells[0].Selected) { DataGridViewRow dr = gv.SelectedCells[0].OwningRow; int id = -1; id = int.Parse(dr.Cells[ChequeEntity.FIELD_ID + "_2"].Value.ToString()); ChequeForm form = new ChequeForm(id); form.initForm(); form.ShowDialog(); if (form.DataChanged1) { FillGrids(); } } } }