如何从GridView中检索数据 [英] how to retrieve the data from gridview
本文介绍了如何从GridView中检索数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请您提供信息如何从文本框中的gridview检索数据
please can u provide the information how to retrieve the data from gridview in textbox
推荐答案
尝试以下代码:
Try the code below:
textbox1.text = GridView1.Rows[0].Cells[0].Text.ToString();
如果您谈论的是ASP.net Web应用程序,则解决方案可能是这样:
String text = ((TextBox)GridView1.Rows(0).Cells(0).FindControl("textboxID")).Text;
您只需要提供放置在网格中的TextBox控件的ID
If you are talking about ASP.net web application, the solution could be this :
String text = ((TextBox)GridView1.Rows(0).Cells(0).FindControl("textboxID")).Text;
you just have to provide the ID of your TextBox Control that you have put in the grid
首先,您必须编写代码以填充网格视图,然后必须编写代码
First of you have to write the code to fill a grid view then you have to write code
textbox1.text=dataGridView1.SelectedRows[0].Cells[0].Value.ToString();
您可以在按钮单击或gridview选择更改事件上编写以上代码
解决方法:
卡比尔
已删除电子邮件ID @ gmail.com
the above code you can write on button click or gridview selection change event
Solution By:
Kabir
EmailIDRemoved@gmail.com
这篇关于如何从GridView中检索数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文