Solved

Adding Button to EditCommandColumn on a dtatagrid footer

Posted on 2004-10-20
3
475 Views
Last Modified: 2012-05-05
Hello all,

What I would like to do is have a databound datagrid on a asp page using c#. This will allow editing and the insertion of new data. I have an EditCommandColumn with the normal edit cancel and delete options defined. All the other columns are template types with a footer defined to hold the fields for the user to create the new row in.

The problem I have is that I need to add a ‘add‘ or submit button to the footer of the EditCommandColumn, is this possible, if so how is it done? I keep getting parse erros if I try the following:-

<asp:EditCommandColumn ButtonType="PushButton" UpdateText="Update" CancelText="Cancel" EditText="Edit">
                              <FooterTemplate>
                                    <asp:LinkButton id="LinkButton1" runat="server">LinkButton</asp:LinkButton>
                              </FooterTemplate>
                        </asp:EditCommandColumn>
0
Comment
Question by:kplonk
  • 2
3 Comments
 
LVL 3

Expert Comment

by:Realmrat
ID: 12367252
I don't think a Column has a "footer".  The footer is defined for the whole datagrid.  Move the footer code outside the column code and that will probably solve your parse errors.

Ex:

                     <asp:EditCommandColumn ButtonType="PushButton" UpdateText="Update" CancelText="Cancel" EditText="Edit">
                              <!-- other code here - styles etc -->
                    </asp:EditCommandColumn>
                     <FooterTemplate>
                              <asp:LinkButton id="LinkButton1" runat="server">LinkButton</asp:LinkButton>
                     </FooterTemplate>

If you are using Visual Studio, the intellisense will let you know what tags you can use within each programming object, and red squiglies will show up in your code if that tag does not go with the schema defined for ASP.NET.

 - Joe
0
 
LVL 3

Accepted Solution

by:
Realmrat earned 20 total points
ID: 12367277
Er, just realized that you need to take that footer code all the way out of the columns arena.

These probably arn't the right tags, but something like this:

<asp:DataGrid ... >
    <HeaderTemplate>
        ...
    </HeaderTemplate>
    <Columns>
        <asp:BoundColumn ... >
                ...
        </asp:BoundColumn >
        <asp:EditCommandColumn ... >
               ...
        </asp:EditCommandColumn>
    </Columns>
    <FooterTemplate>
        ...
    </FooterTemplate>
</asp:DataGrid>


Hope that helps.

 - Joe
0
 

Author Comment

by:kplonk
ID: 12592767
Thanks Kieran
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Server Error 11 58
Run time Error 4 48
System.Speech 2 28
tableview is not updating 1 10
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question