private void dataGrid_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { db_anum = dataGrid.Rows[e.RowIndex].Cells[0].Value.ToString(); db_name = dataGrid.Rows[e.RowIndex].Cells[1].Value.ToString(); db_age = Convert.ToInt32(dataGrid.Rows[e.RowIndex].Cells[2].Value); db_address = dataGrid.Rows[e.RowIndex].Cells[5].Value.ToString(); db_a_card = Convert.ToInt64(dataGrid.Rows[e.RowIndex].Cells[6].Value); db_contact = Convert.ToDouble(dataGrid.Rows[e.RowIndex].Cells[7].Value); db_d_desc = dataGrid.Rows[e.RowIndex].Cells[8].Value.ToString(); db_hosp_name = dataGrid.Rows[e.RowIndex].Cells[9].Value.ToString(); db_gender = dataGrid.Rows[e.RowIndex].Cells[3].Value.ToString(); db_aadhar = Convert.ToInt64(dataGrid.Rows[e.RowIndex].Cells[4].Value); db_amt = Convert.ToInt32(dataGrid.Rows[e.RowIndex].Cells[10].Value); this.Hide(); claimcell cc = new claimcell(); cc.Show(); }catch (Exception ex) { } }
private void dataGrid_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { string name, info; name = dataGrid.Rows[e.RowIndex].Cells[1].Value.ToString(); info = dataGrid.Rows[e.RowIndex].Cells[2].Value.ToString(); this.Hide(); if (ctxt == "arogyaClaim") { arogyaClaim ac = (arogyaClaim)Application.OpenForms["arogyaClaim"]; ac.ddesc.Text = name; ac.dinfo.Text = info; } else if (ctxt == "claimcell") { claimcell c = (claimcell)Application.OpenForms["claimcell"]; c.ddesc.Text = name; c.dinfo.Text = info; c.amount.Text = ""; } }