如何在窗口应用程序的gridview中获取文本框值 [英] how to get textbox value in gridview in window application
本文介绍了如何在窗口应用程序的gridview中获取文本框值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在窗口应用程序的gridview中获取文本框值
how to get textbox value in gridview in window application
推荐答案
尝试这样
dataGrivView1[0,0].Value = txtbox1.Text;
或
将文本框值分配给数据行,例如
or
assign the textbox values to datarow like
DataRow rd;
rd[0]=txtbox1.text;
and declare a data table
datatable dt=new datatable;
dt.rows .add(rd);
dataGridView.Datasource=dt;
或
or
DataGridViewRow row = new DataGridViewRow();
row.CreateCells(this.dataGridView1, textBox1.Text, textBox2.Text, textBox3.Text);
this.dataGridView1.Rows.Add(row);
请参阅此类似的CP Q& A(解决方案6),
如何从文本框中插入值网格视图 [ ^ ]
Refer to this similar CP Q&A (solution 6),
How to insert a value from text box to grid view[^]
Periyasamy,
试试这个-
Hi Periyasamy,
Try this-
dataGridView1.CurrentRow.Cells["Column name"].Value = textBox1.Text;
这篇关于如何在窗口应用程序的gridview中获取文本框值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文