如何在C#.net Windows应用程序中没有数据库的情况下将文本框中的文本传递到数据gridview?
问题描述:
完成数据输入文本框后,我想将文本框中的文本传递到数据gridview单元格.最好在没有数据库的情况下完成此操作.
这是一个C#.net Windows应用程序.
请帮我.
I want to pass text in text boxes to the data gridview cells once I finished the data entering in to the text boxes.This is better to be done without having a database.
This is a C#.net windows application.
Pls kindly help me.
答
假设您不想使用绑定,那么DataGridView类上的所有信息都是 ^ ].您只需使用各种类方法来创建列和行并添加数据.
Assuming you mean that you do not want to use binding then all the information on the DataGridView class is here[^]. You just use the various class methods to create columns and rows and add your data.
使用此;)
datagridview.rows [0] .cells [0] .value = textbox.text;
use this ;)
datagridview.rows[0].cells[0].value=textbox.text;