gridview contol for footer template [Resolved]

Posted by reddysankark-13471 under ASP.NET on 2/4/2012 | Points: 10 | Views : 12728 | Status : [Member] | Replies : 1
hi,

i will type this code in design view its not showing the footer whwt will be the error

<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server" CellPadding="3" GridLines="Both"
Font-Names="Verdana" Font-Size="10" DataKeyNames="productID"
AutoGenerateColumns="false" OnRowCancelingEdit="GridView1_RowCancelingEdit"
OnRowEditing="GridView1_RowEditing" AllowSorting="true" AlternatingRowStyle-BackColor="Aqua"
onrowupdating="GridView1_RowUpdating" onrowdatabound="GridView1_RowDataBound"
Height="223px" Width="641px">
<HeaderStyle BackColor="#336699" ForeColor="White" HorizontalAlign="Left" Height="25" />
<Columns>
<asp:CommandField ButtonType="Button" ShowEditButton="true" ShowCancelButton="true" />
<asp:BoundField DataField="ProductID" HeaderText="Product ID" ReadOnly="true" />
<asp:TemplateField HeaderText="Name">
<ItemTemplate>
<%# Eval("productName")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" ID="txtproductName" Text='<%# Eval("productName")%>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Quantity">
<ItemTemplate>
<%# Eval("qty")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" ID="txtqty" Text='<%# Eval("qty")%>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="UnitPrice">
<ItemTemplate>
<asp:Label ID="lblPrice" runat="server" Text='<%# Eval("price")%>' />
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTotalPrice" runat="server" />
</FooterTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#336699" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" Height="25" />

<AlternatingRowStyle BackColor="Aqua"></AlternatingRowStyle>
</asp:GridView>
<b>Average Price: </b>
<asp:Label ID="lblAveragePrice" runat="server" Text="Label"></asp:Label>

</div>
</form>

sankarreddy


Responses

Posted by: Ogipansrk on: 2/5/2012 [Member] Starter | Points: 50

Up
0
Down

Resolved
Use the below property in Gridview

ShowFooter="true"

if it helps mark it as answer

reddysankark-13471, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response