页脚模板文本框,按钮不显示

问题描述:

在gridview页脚模板文本框和按钮中不显示在设计视图中并在运行程序时



我尝试过:



in gridview footer template textbox and button not displaying in design view and while run the program

What I have tried:

<div>
    <asp:GridView runat="server" ID="gvDetails" AllowPaging="true" PageSize="10" 
            AutoGenerateColumns="false" DataKeyNames="productid" 
            OnPageIndexChanging="gvDetails_PageIndexChanging" OnRowCancelingEdit="gvDetails_RowCancelingEdit"
OnRowEditing="gvDetails_RowEditing" OnRowUpdating="gvDetails_RowUpdating" 
            OnRowDataBound="gvDetails_RowDataBound" Width="550px" Height="198px" 
            onrowdeleting="gvDetails_RowDeleting" >

<Columns>
<asp:BoundField DataField="productid" HeaderText="Product Id" ReadOnly="true" />
<asp:BoundField DataField="productname" HeaderText="Product Name" />
<asp:BoundField DataField="price" HeaderText="Price" />

<asp:TemplateField HeaderText = "Price List">
<FooterTemplate>
            <asp:TextBox ID="txtprice" runat="server"></asp:TextBox>
            <asp:Button ID="btnAdd" CommandName="AddNew" runat="server" Text="Add"></asp:Button><br />
            </FooterTemplate>
 
<EditItemTemplate>
<asp:HiddenField ID="hdnprice" runat="server" Value='<%#Eval("price") %>' />
<asp:DropDownList ID = "ddlprice" runat = "server">
</asp:DropDownList>
</EditItemTemplate>
           
            
</asp:TemplateField>

<asp:CommandField ShowEditButton="True" ShowDeleteButton="True"/>
</Columns>
</asp:GridView>
<asp:Label ID="lblresult" runat="server"></asp:Label>

    </div>

在网格视图标记中使用以下代码;

use below code in grid view tag;
ShowFooter="true"