简体   繁体   中英

value of a cell in gridview aspx page vb.net web app

I have a gridview with several columns. I need that, when the user click the button "ver" ("see" in English) I get the value of the cell(1). I inserted a textbox to see if I get the value but it doesn't return any Data. I already read a lot in the net and tried almost everything i read, and still don't know what I'm doing wrong. Anyone could help me? 在此处输入图片说明

The code:

Protected Sub GridView1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles GridView1.SelectedIndexChanged

    Dim codigo As String = GridView1.SelectedRow.Cells(1).Text

    TextBox1.Text = codigo

End Sub

Finnaly, I got it. I deleted the button "ver" and put a ComandField ---> Select, and now it's working. 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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