页脚模板文本框,按钮不显示 [英] Footer template textbox, button not displaying

查看:62
本文介绍了页脚模板文本框,按钮不显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在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"


这篇关于页脚模板文本框,按钮不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆