I have 2 forms:
Form1
containsDataGridView
controlsForm2
containsTextbox
controls (are in mode read only), checkBox and Button.
When I select a DataGridView
Row it will show me Form2 and display their values in TextBoxes. Everything seems better just now.
What I want know is after displaying data in textboxes, I check the RadioButton then click the button it will return to Form1 of the selected Row and Change the value of Cell 4 automatically.
Here there is My code:
Form1
private void dataGridView1_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
{
DataGridViewCell cell = null;
foreach (DataGridViewCell selectedCell in dataGridView1.SelectedCells)
{
cell = selectedCell;
break;
}
if (cell != null)
{
DataGridViewRow row = cell.OwningRow;
string objet = row.Cells[0].Value.ToString();
string objectif = row.Cells[1].Value.ToString();
string date = row.Cells[2].Value.ToString();
string commentaire = row.Cells[3].Value.ToString();
string client = row.Cells[5].Value.ToString();
string commercial = row.Cells[6].Value.ToString();
Détails_RDV détails = new Détails_RDV();
détails.obj = objet;
détails.objectif = objectif;
détails.date = date;
détails.comm = commentaire;
détails.clt = client;
détails.commer = commercial;
détails.Show();
}
}
Form2
public partial class Détails_RDV : Form
{
public string obj ;
public string objectif;
public string date;
public string comm;
public string clt ;
public string commer;
public Détails_RDV()
{
InitializeComponent();
}
private void Détails_RDV_Load(object sender, EventArgs e)
{
txtObjet.Text = obj;
txtObjectif.Text = objectif;
txtDate.Text = date;
txtCommerci.Text = commer;
txtClient.Text = clt;
txtCommentaire.Text = comm;
}
private void btnValider_Click(object sender, EventArgs e)
{
if (checkEffectue.Checked == true)
{
//What should I write here??
Liste_RDV lrdv = new Liste_RDV();
lrdv.Show();
}
}
How Can I do That ?