Click here to Skip to main content
16,016,623 members
Please Sign up or sign in to vote.
2.67/5 (3 votes)
See more:
Hi All,

I am using asp.net Gridview control.
I attached datasource to Gridview to display records in Gridview.

Below is my Gridview aspx
C#
<asp:GridView ID="GridView1" runat="server" Width="100%"
                    AutoGenerateColumns="False" DataSourceID="SqlDataSource1" CellPadding="4" 
                    ForeColor="#333333" GridLines="None">
                    <AlternatingRowStyle BackColor="White"/>
                    <Columns>
                        <asp:BoundField DataField="S.No" HeaderText="S.No" SortExpression="S.No" ItemStyle-HorizontalAlign="Right" />
                        
                        <asp:BoundField DataField="Currency Name" HeaderText="Name"
                            SortExpression="Currency Name"/>
                        
                        <asp:BoundField DataField="Currency Code" HeaderText="Code" 
                            SortExpression="Currency Code"/>
                        
                        <asp:BoundField DataField="Currency Symbol" HeaderText="Symbol" 
                            SortExpression="Currency Symbol"/>
                        
                        <asp:BoundField DataField="Status" HeaderText="Status" 
                            SortExpression="Status"/> 
                        <asp:TemplateField HeaderText="Actions">
                            <ItemTemplate>                
                                <asp:ImageButton ID="imgbtndetails" runat="server" ImageUrl="~/Images/edit.jpg" Height="30px" Width="30px" OnClick="imgbtn_Click" />                                             
                            </ItemTemplate>                                                                                   
                       </asp:TemplateField> 
                       <asp:TemplateField>                       
                           <ItemTemplate>
                               <asp:ImageButton ID="imgbtndelete" runat="server" ImageUrl="~/Images/delete.jpg" Height="30px" Width="30px"/>
                           </ItemTemplate> 
                           <FooterTemplate><asp:Button ID="btnfooter" runat="server" Text="Save" onclick="btnfooter_Click" /></FooterTemplate>                      
                       </asp:TemplateField>                                                  
                    </Columns></asp:GridView>


Now Gridview is displaying 2 records from database.Now I want add records from footer template.
On A button click I want to display footer template below.
Can anyone tell me the design to display Footer template to enter new records.

Thank you,
palcordis
Posted

1 solution

 
Share this answer
 
v2
Comments
palcordis 8-Aug-12 6:16am    
Thank you,

I have one more query,I am using Boundfield property to fetch the data from datasource.

I want the footer template to be displayed below the boundfield item.
If I use footer template in Template field it is displaying footer in different columns.But I want to footer template below the Boundfield.

Could please tel me how can I achieve this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900