ASP DOt NET itemTemplate in GridView
How to add Textbox in gridview and how to ac开发者_如何学Gocess to it and perform some calculations like Serno,Name,ServAmnt,Qty,Disc,netamt
netamt=servamnt*qty*discount
Take a look at the GridView Examples for ASP.NET 2.0: Working with TemplateFields MSDN tutorial as a strating point:
Specify TemplateField.ItemTemplate;
Put the asp:TextBox control into template;
Bind the required TextBox’s property via the binding expression with the required field from the underlying datasource:
<asp:TemplateField>
<ItemTemplate>
<asp:TextBox ID="txtUnitPrice" runat="server" Text='<%#Eval("UnitPrice")%>'>
</asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
精彩评论