private void dgvCashFlow_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex > -1 && e.ColumnIndex > -1) { string id = null; CashFlow _objCashFlow = new CashFlow(dgvCashFlow.Rows[dgvCashFlow.CurrentRow.Index].Cells["ledgerId"].Value.ToString()); _objCashFlow.Show(); } }