1、在<asp:TemplateField></asp:TemplateField>之间插入一个Button,设置CommandName及CommandArgument属性.
如:
<asp:Button ID="bnSpecify" runat="server" Text="祥" Font-Size="X-Small" CommandName="leanTest" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>"
2、设置GridView的OnRowCommand事件中根据CommandName判断是那一个按钮被激发了,当然首提是你要知道按了那一行的按钮,CommandArgument的内容就是当前的行号了.
如: