Reputation: 13
I'm having a GridView of about 7000 rows and i want to add an update button on each row. When the user click that button,i want to display all the information in that particular row into the textboxes and let the user update and save.
The names of my textboxes are:
txtEmployeeNumber, txtSurname, txtFirstName, txtPosition
My GridView name is: gvMain My server name is: bisweb\bisweb My database name is: x_kgabo Can anyone help!
Upvotes: 0
Views: 935
Reputation: 9668
<asp:TemplateColumn>
<ItemTemplate>
<asp:Button Runat="server" ID="makeSomehtingButton"
CommandName="makeSomething"
CommandArgument='<%# DataBinder.Eval(Container.DataItem,"ID") %>'>
</asp:Button>
</ItemTemplate>
</asp:TemplateColumn>
Upvotes: 1
Reputation: 52241
Simply add template field in your gridview
<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton ID="ibtnRateIt" CommandArgument='<%# Eval("id") %>' CommandName="RateIt"
runat="server" ImageUrl="~/Images/RateIt.gif" />
</ItemTemplate>
</asp:TemplateField>
Upvotes: 1