HI all,
I had a gridview in which users are listed in that. In that gridview i had an edit option so that i can edit user details. so my problem is... when i click edit in a row i need the userid present in that row.
Thank you.
here is my asp code.
<asp:GridView ID="GridView1" runat="server" DataKeyNames="LoginId" Width="1100px"
AllowSorting="true" AllowPaging="true" BorderColor="#EED3D3"
AutoGenerateColumns="false" onsorting="GridView1_Sorting"
OnPageIndexChanging="GridView1_PageIndexChanging">
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#EFF3FB" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:TemplateField HeaderText="Edit">
<ItemTemplate>
<asp:ImageButton ID="imgbtn" ImageUrl="~/Images/edit-icon.png" AlternateText="Edit" runat="server" Width="25" Height="25" OnClick="imgbtn_Click" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="LoginId" HeaderText="LoginId" SortExpression="LoginId" />
<asp:BoundField DataField="UserName" HeaderText="UserName" SortExpression="UserName" />
<asp:BoundField DataField="Password" HeaderText="Password" SortExpression="Password" />
<asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
</Columns>
</asp:GridView>