11.17日,GridView 的RowCommand事件中,e.CommandArgument不是行号,那么要取这一行的某一列怎么办
时间:2010-11-17 来源:挑战自我
问题:<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();
相关阅读 更多 +
排行榜 更多 +