简体   繁体   English

从Gridview到文本框获取值

[英]Get values from Gridview to textbox

How can I get data from a gridview to a textbox. 如何将数据从gridview获取到文本框。 I tried using: 我尝试使用:

TextBox3.Text = GridView1.Rows(1).cell(1).text; 

but no luck. 但没有运气。

在此处输入图片说明

Use 采用

TextBox3.Text = GridView1.Rows[1].Cells[1].Value.ToString();

Or 要么

TextBox3.Text = GridView1.Rows[1].Cells[1].Text;

you where close. 你在哪里。 The Rows is an array, so u have to use brackets to get the index of an array 行是一个数组,因此您必须使用方括号来获取数组的索引

TextBox3.Text = GridView1.Rows[1].Cells[1].Value.ToString();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM