我正在制作一个使用MySQL数据库的C#应用​​程序

时间:2014-01-03 01:33:13

标签: c# mysql database textbox editing

我正在制作该程序,但我希望能够点击dataGridView中的一个框并让该文本可编辑

OR

我希望能够单击一行,并将dataGridView中的文本输入到各种textBoxes

这可能吗?如果是这样,怎么样?

1 个答案:

答案 0 :(得分:0)

例如:

DataTable table = new DataTable();
//put some data in your table and then
table.Columns.Add("C1");
table.Columns.Add("C2");
String[] examplerow = new String[] {"one","two"};
table.Rows.Add(examplerow);
DataRow row = table.Rows[0];
Console.WriteLine(row["C1"]); // Or pass it to textboxes, etc