Adding record using Gridview Footer

Locc

New Member
i'm adding a new record using the footer of my gridview, although I don't like the formatting. I'd like to be able to have my save/cancel buttons in line with the edit/delete commandfield. I can't work out how to do it. Can someone please assist.Cheers\[code\]<asp:GridView ID="Grd" runat="server" AutoGenerateColumns="false" OnRowEditing="Grd_RowEditing" OnRowCancelingEdit="Grd_RowCancelingEdit" OnRowUpdating="Grd_RowUpdating" Width="600px" CssClass="HomeDG" SelectedRowStyle-CssClass="HomeDGSelected" RowStyle-CssClass="HomeDGItem" AlternatingRowStyle-CssClass="HomeDGAlternating" HeaderStyle-CssClass="HomeDGhead" PageSize="10"> <Columns> <asp:TemplateField HeaderText="Employee"> <ItemTemplate> <asp:HiddenField ID="hfID" runat="server" Value='http://stackoverflow.com/questions/15528164/<%# Bind("Emp_ID")%>' /> <asp:Label ID="LblEmployee" runat="server" Text='<%# Bind("Emp_Name")%>'></asp:Label> </ItemTemplate> <FooterTemplate> <asp:DropDownList ID="ddlNewEmp" runat="Server" /> </FooterTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Start Date"> <EditItemTemplate> <asp:TextBox ID="TxtStartDate" runat="server" Text='<%# Eval("Start_Date","{0:dd-MMM-yyyy}") %>'></asp:TextBox> </EditItemTemplate> <FooterTemplate> <asp:TextBox ID="TxtStartDate" runat="Server" /> <asp:CalendarExtender ID="calStartDate" runat="server" TargetControlID="TxtStartDate" Format="dd-MMM-yyyy" /> <asp:Button ID="btnAddNewSave" runat="server" Text="Save" CausesValidation="False" OnClick="btnAddNewSave_Click" /> <asp:Button ID="btnAddNewCancel" runat="server" Text="Cancel" OnClick="btnAddNewCancel_Click" /> </FooterTemplate> </asp:TemplateField> <asp:CommandField ShowEditButton="True" ShowDeleteButton="True" CausesValidation="False" /> </Columns> </asp:GridView> <asp:Button ID="btnAddNew" runat="server" Text="Add" CausesValidation="False" OnClick="btnAddNew_Click" />\[/code\]
 
Back
Top