GridVeiw中有一个LinkButton1.点击LinkButton1进入RowCommand事件。
问题:<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" CommandName="SelectLaLo" CommandArgument='<%# Eval("name") %>'
Text="查看" ></asp:LinkButton>
从这里可以看到,e.CommandArgument不是行号。
问题: 那么我要怎么样获取这一行的某一列呢?
解决: GridViewRow row=((LinkButton )e.CommandSource).Parent.Parent as GridViewRow;
string address=row.Cells[3].Text.Tostring();