<asp:GridView ID="GridView1" runat="server">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" OnClick="lclick">Buy</asp:LinkButton>
</ItemTemplate>
<edititemtemplate>
<asp:Textbox runat="server" id="txt"/>
<edititemtemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Is it possible to edit the GridView
without the edititem
Template?
I have done this before and I can only explain what I did
To make sure my edit controls is part of viewstate I added an empty form to the bottom of my page
<div id="myeditform">
<table>
<tr>
<td><asp:HiddenField runat="server" ID="myRowId" />
</td>
<td>... other controls </td>
<td>... Save button -- </td>
</tr>
<table>
</div>
The tr(s) has to match the number of columns in your grid or you can use colspan
Then
td
to the respective control in your edit form. <tr>
with the content of the table in your edit form
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.