在Windows中的网格中绑定文本框值 [英] bind textbox values in grid in windows
本文介绍了在Windows中的网格中绑定文本框值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个文本框和一个按钮
单击按钮后,我们必须在Windows中的数据网格中显示该数据.
I have text box and a button
After button click we have to show that data in my datagrid in windows.
推荐答案
http://www.aspdotnet-suresh.com/2012/05/bind-data-to-textbox-in-inside-of. html [ ^ ]
http://social.msdn.microsoft.com/Forums/zh/winformsapplications/thread/f4e87150-d5b6-4dc3-8b93-5f1f222beabf [
http://www.aspdotnet-suresh.com/2012/05/bind-data-to-textbox-in-inside-of.html[^]
http://social.msdn.microsoft.com/Forums/en/winformsapplications/thread/f4e87150-d5b6-4dc3-8b93-5f1f222beabf[^]
请参阅以下链接.
从ASP.NET Gridview动态添加和删除行 [ ^ ]
Refer the below link.
Dynamically Adding and Deleting rows from ASP.NET Gridview [^]
尝试此操作可能会帮助您
Try this it may help u
private void button1_Click(object sender, EventArgs e)
{
DataTable dtToGrid = new DataTable();
DataRow drToGrid;
dtToGrid.Columns.Add(new DataColumn("EMP_ID", typeof(string)));
dtToGrid.Columns.Add(new DataColumn("EMP_FName", typeof(string)));
dtToGrid.Rows.Add();
dtToGrid.Rows[0][0] = txt_empid.Text;
dtToGrid.Rows[0][1] = txt_fname.Text;
dataGridView.DataSource = dtToGrid;
}
这篇关于在Windows中的网格中绑定文本框值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文