I have a gridviewMain. Whenever I click the CLOSE linkbutton for row 1 I want to get the value aa. Click Close on row 2 get the value of bb. Any ideas.
A B C
aa xx 3 CLOSE
bb yy 4 CLOSE
cc zz 5 CLOSE
aspx
<asp:BoundField DataField="afield" HeaderText="A"
SortExpression="afield" >
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="bfield" HeaderText="B" SortExpression="cfield" >
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="cfield" HeaderText="C" SortExpression="cfield" >
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="lbClose" runat="server" CausesValidation="False" CommandName="CloseClicked" Text="Close"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>