从form1 datagrid到表单2上的文本框中的数据 [英] sand data from form1 datagrid to textbox on form 2

查看:79
本文介绍了从form1 datagrid到表单2上的文本框中的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过按下按钮并在datagridview中按一个文本框搜索数据,只需键入数据字符串的某些部分,然后选择数据并发送到表单2文本框,即可将数据从表单1数据网格视图拖放到表单2上的文本框





如何通过命令而不是通过属性更改将数据源连接到datagridview thnks

how can i sand data from form 1 datagridview to text box on form 2 by pressing button & search data in datagridview by one text box by just typing some part of string of data then select the data and send to form 2 text box


how can i connect data source to datagridview by command not by property change thnks

推荐答案

究竟如何取决于表格之间的关系。

见这些:

在两种形式之间传递信息,第1部分:父母与子女 [ ^ ]

在两种表格之间转移信息,第2部分:儿童到父母 [ ^ ]

在两种表格之间传递信息,第3部分:儿童与儿童 [ ^ ]



如果表单创建了另一个表单的实例,则它是Parent,新表单是Child。
Exactly how depends on the relationship between the forms.
See these:
Transferring information between two forms, Part 1: Parent to Child[^]
Transferring information between two forms, Part 2: Child to Parent[^]
Transferring information between two forms, Part 3: Child to Child[^]

If a form creates an instance of another form, then it is the Parent, and the new form is the Child.


Hello TUMAAJKAL,



要在按钮单击时将form1 GridView中的数据发送到form2上的文本框,请执行以下步骤:



1.)在form1中,on buttonClick事件:

Hello TUMAAJKAL,

To Send data from form1 GridView to Textbox on form2 on button click, perform the following step:

1.) In form1, on buttonClick event:
string Name = GridView1.Rows[0].Cells[0].Text;
/* store particular row & column value in Name variable*/
Response.Redirect("Form2.aspx?Name="+ Name );
/*Send Name variable to form2*/



2.)现在在Form2上获取Name变量到Textbox。在Form2 Page_Load()事件中编写以下代码:


2.) Now get Name variable to Textbox on form2. In Form2 Page_Load() event write following code:

TextBox1.Text = Request.QueryString["Name"];
/*store Name variable value to TextBox1*/



i希望你能从这个答案中得到正确的结果,不要忘记接受这个解决方案....谢谢。


i hope you will get your right result from this answer, and dont forget to accept this solution.... thank you.


要在GridView中搜索数据,请参考以下文章,



http://www.aspdotnet-suresh.com/2011/12/search-records-in-gridview-and.html [ ^ ]



谢谢。
To search Data in GridView please refer the following article,

http://www.aspdotnet-suresh.com/2011/12/search-records-in-gridview-and.html[^]

thank you.


这篇关于从form1 datagrid到表单2上的文本框中的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆