I want to get data from Datagridview to text boxes but i want every row i select should be show in multiple text boxes? I am doing it but it is only select one row and show in one text box but i want to get data of multiple rows to multiple Textboxes.
private void dataGridView_1CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) {
// to set oem no to textfield particular.
dataGridView1.Refresh();
try {
int i;
i = dataGridView1.SelectedCells[0].RowIndex;
Particular1Txt.Text = dataGridView1.Rows[i].Celles["OEM_No"].Value.ToString();
}
catch (Exception ex) {
MessageBox.Show(es.Message);
}
}
Well, this should work (not tested thoroughly):
VB:
Converted C#:
It will use as many textboxes as inserted to the list of textboxes, or as many rows as selected, which ever is less.