private void choosCust_Click(object sender, EventArgs e) { PL.CustomersList cu = new CustomersList(); cu.ShowDialog(); // first show the dialoge and doubleClick(Event was set in the list form) // then the form will close and here we fech data // the closing is just for the user this.Cus_id.Text = cu.ListGridVeiw.CurrentRow.Cells[0].Value.ToString(); this.ClientName.Text = cu.ListGridVeiw.CurrentRow.Cells[1].Value.ToString() + " " + cu.ListGridVeiw.CurrentRow.Cells[2].Value.ToString(); // this.debtText.Text = cu.ListGridVeiw.CurrentRow.Cells[5].Value.ToString(); }
private void CustChoosBtn_Click(object sender, EventArgs e) { PL.CustomersList cu = new CustomersList(); cu.ShowDialog(); // first show the dialoge and doubleClick(Event was set in the list form) // then the form will close and here we fech data // the closing is just for the user this.custId.Text = cu.ListGridVeiw.CurrentRow.Cells[0].Value.ToString(); this.custfirstNAme.Text = cu.ListGridVeiw.CurrentRow.Cells[1].Value.ToString(); this.custLastName.Text = cu.ListGridVeiw.CurrentRow.Cells[2].Value.ToString(); this.custPhone.Text = cu.ListGridVeiw.CurrentRow.Cells[3].Value.ToString(); this.custAddress.Text = cu.ListGridVeiw.CurrentRow.Cells[4].Value.ToString(); }