private void btn_AddNew_Click(object sender, EventArgs e) { Add_Broker add_Broker = new Add_Broker(); ButtonClicked.addBrokerMaster = (sender as Button).Text; add_Broker.ShowDialog(); refreshBrokerGrid(); }
private void btn_Display_Click(object sender, EventArgs e) { Add_Broker add_Broker = new Add_Broker(); ButtonClicked.displayBrokerMaster = (sender as Button).Text; add_Broker.lbl_ID.Text = dg_Broker.CurrentRow.Cells[7].Value.ToString(); add_Broker.txt_Name.Text = dg_Broker.CurrentRow.Cells[1].Value.ToString(); add_Broker.rt_Address.Text = dg_Broker.CurrentRow.Cells[2].Value.ToString(); add_Broker.txt_ContactNo.Text = dg_Broker.CurrentRow.Cells[3].Value.ToString(); add_Broker.txt_Country.Text = dg_Broker.CurrentRow.Cells[4].Value.ToString(); add_Broker.txt_State.Text = dg_Broker.CurrentRow.Cells[5].Value.ToString(); add_Broker.txt_PostalCode.Text = dg_Broker.CurrentRow.Cells[6].Value.ToString(); add_Broker.ShowDialog(); }