VB.NET的話就多寫幾行程式吧XD
Protected Sub GridView1_RowCommand(ByVal sender As Object, _
ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) _
Handles GridView1.RowCommand
'這邊我設定ButtonField的CommandName是"ClickButton"
If e.CommandName = "ClickButton" Then
'取得Sender並轉成GridView
Dim gv As GridView = CType(sender, GridView)
'把i代入你要取得的欄位索引值
Response.Write(gv.Rows(CInt(e.CommandArgument)).Cells(i).Text & _
"<br />")
End If
End Sub
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 219.70.231.208