tsbathe
asked on
Datagrid footer - basic question
I have seen a few articles on adding a "add new record" sort of feature in the footer of a datagrid. I would like to know if it is possible to do the following:
Have an EditCommandColumn and a DeleteCommandColumn that has a footer template so that I can add the "add" button in the footer of the EditCommandColumn and a "Cancel" button in the footer of the DeleteCommandColumn.
I attempted to do this by turning the Edit/DeleteCommandColumns into Template columns and then the appropriate commandevents stopped working and became intercepted by the itemcommand event. Here is what I did for the edit command column:
<asp:TemplateColumn>
<ItemTemplate>
<asp:LinkButton runat="server" Text="Edit" CommandName="Edit" CausesValidation="false">< /asp:LinkB utton>
</ItemTemplate>
<FooterTemplate>
<asp:linkbutton ID="lnkAdd" Runat="server" Text="Add" CommandName="Add"></asp:li nkbutton>
</FooterTemplate>
<EditItemTemplate>
<asp:LinkButton runat="server" Text="Update" CommandName="Update"></asp :LinkButto n>
<asp:LinkButton runat="server" Text="Cancel" CommandName="Cancel" CausesValidation="false">< /asp:LinkB utton>
</EditItemTemplate>
</asp:TemplateColumn>
Thanks for your help! I've been working on this for days and it's driving me nuts!!
Have an EditCommandColumn and a DeleteCommandColumn that has a footer template so that I can add the "add" button in the footer of the EditCommandColumn and a "Cancel" button in the footer of the DeleteCommandColumn.
I attempted to do this by turning the Edit/DeleteCommandColumns into Template columns and then the appropriate commandevents stopped working and became intercepted by the itemcommand event. Here is what I did for the edit command column:
<asp:TemplateColumn>
<ItemTemplate>
<asp:LinkButton runat="server" Text="Edit" CommandName="Edit" CausesValidation="false"><
</ItemTemplate>
<FooterTemplate>
<asp:linkbutton ID="lnkAdd" Runat="server" Text="Add" CommandName="Add"></asp:li
</FooterTemplate>
<EditItemTemplate>
<asp:LinkButton runat="server" Text="Update" CommandName="Update"></asp
<asp:LinkButton runat="server" Text="Cancel" CommandName="Cancel" CausesValidation="false"><
</EditItemTemplate>
</asp:TemplateColumn>
Thanks for your help! I've been working on this for days and it's driving me nuts!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
yeah u have to use e.CommandName.....
ASKER
YES!!! You are right!!!!! I did not understand that, thank you so much!!!!!!
edit and delete don't fire....or any exception...