将值从GridView导入文本框控件 [英] Getting Values from GridView into textbox control

查看:100
本文介绍了将值从GridView导入文本框控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有gridview.
我可以知道如何从用户单击gridview到文本框的行中获取值..

在此先感谢

I have gridview.
May i know how to get values from the row the user clicks on gridview into the textboxes..

Thanks in advance

推荐答案

您可以通过使用gridview的SelectedIndexChanged事件来实现.其他方式也有.您可以使用此事件.获取此事件中的SelectedDataKey和相应的详细信息.
You can do it by using SelectedIndexChanged event of the gridview. Other ways also there. You can use this event. Get the SelectedDataKey and corresponding details in this event.


在gridview中添加选择命令字段.

在gridview_SelectedIndexChanged事件中,代码如下:

Textbox1.Text = gridview1.selectedrow.cell(1).text

这里的1是gridview的列.

快乐编码:)
Add Select command field in your gridview.

in gridview_SelectedIndexChanged event do code as:

Textbox1.Text=gridview1.selectedrow.cell(1).text

Here, 1 is the column of gridview.

Happy Coding :)


这篇关于将值从GridView导入文本框控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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