开发者

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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜