如何将GridView数据检索到texbox [英] how to retrieve gridview data to a texbox
本文介绍了如何将GridView数据检索到texbox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好.
我只想问一下如何获取或检索在gridview上选择的当前行.我正在使用VB语言.我找到了这个答案
hello.
I just want to ask how can I get or retrieve the current row that I select on the gridview.. I''m using the VB language.. I found this answer click here
but it didn''t work :(
can anyone tell me the answer?? :(
textbox1.text = ???????
badly needed. thanks! :)
推荐答案
您提供的链接适用于Windows窗体.它不能那样工作.
请尝试以下,
CS
The link you provided is for Windows Forms. It does not work like that.
Try the below,
CS
(GridView1.Rows[YOUR_ROW_INDEX].FindControl(YOUR_CONTROL_NAME) as TextBox).Text
VB
VB
CType(GridView1.Rows(YOUR_ROW_INDEX).FindControl(YOUR_CONTROL_NAME), TextBox).Text
或
CS
or
CS
(GridView1.Rows[YOUR_ROW_INDEX].Cells[YOUR_CELL_INDEX].Controls(YOUR_CONTROL_INDEX) as TextBox).Text
VB
VB
CType(GridView1.Rows[YOUR_ROW_INDEX].Cells[YOUR_CELL_INDEX].Controls(YOUR_CONTROL_INDEX), TextBox).Text
如果有帮助则将其标记为答案
Mark it as answer if it is helpful
看看 ^ ].这应该可以帮助您.
Have a look here[^]. This ought to help you out.
这篇关于如何将GridView数据检索到texbox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文