例如,在一個形式中的dataGridView細胞的詞語是:一個;二;三.....解析文本從DataGridView到文本框
我想分開該顯示在窗口2在文本框:
text in textBox1: one
text in textBox2: two
text in textBox3: three
我該如何解析?
我填寫的DataGrid中formOne這樣:
foreach (DataGridViewCell cell in dataGridView1.SelectedCells)
{
string text = "";
for (int i = 0; i < emails.Length ;i++)
{
if (emails[i].ToString().Trim() != "")
{
text = text + emails[i] + ";" ;
dataGridView1.Rows[cell.RowIndex].Cells[col].Value = text;
}
}
}
我正確的假設你只是想從DataGridView中的某些單元格中提取值並將這些值放在TextBoxes中? – Recipe
我想從dataGridView中的一個單元格提取到更多帶分隔符的文本框; – John