如何在文本框中输入文本值以添加datagrid语法 [英] how to textbox text value add a datagrid syntax
本文介绍了如何在文本框中输入文本值以添加datagrid语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在文本框中输入文本值以添加datagrid语法
how to textbox text value add a datagrid syntax
推荐答案
如果Datagrid是动态构建的:
If the Datagrid is build on the fly:
DataGridView1.Rows.Add(New Object() {TextBox1.Text})
此处,文本放置在新行的第1列中.
或者,如果Datagrid已经存在(具有x列和y行):
Here the Text is placed in a new row, column 1.
Or if the Datagrid already exists (with x columns and y rows):
DataGridView1.Rows(0).Cells(0).Value = TextBox1.Text
此处的文本位于第1行第1列.
Here the Text is placed in row 1, column 1.
datagrid.column(0).text = text1.text
datagrid.column(0).text=text1.text
这篇关于如何在文本框中输入文本值以添加datagrid语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文