//this is my textboxes that will retrieve data textBox5.Text = ""; textBox6.Text = ""; textBox8.Text = ""; textBox7.Text = ""; //this is the code of mine it works only when i select a row from the datagridview i need it work when i select a cell in this row string[] arr = new string[4]; int i = 0; foreach (DataGridViewCell item in dataGridView2.SelectedCells) { arr[i] = item.Value.ToString(); i++; } textBox5.Text = arr[0].ToString(); textBox6.Text = arr[1].ToString(); textBox8.Text = arr[2].ToString(); textBox7.Text = arr[3].ToString();
foreach (DataGridViewCell item in dataGridView2.CurrentRow.Cells) { arr[i] = item.Value.ToString(); i++; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)