datagrid commands

Discussion in 'ASP .Net' started by Roel, May 24, 2004.

  1. Roel

    Roel Guest

    Hello,

    I built an application that shows the file of a folder on a website.

    I present it by using a datagrid. Now, I want to add some functionalities to
    the datagrid like, the possibility to delete the file. Therefore I use the
    deletecommand -event. But I also want to add print functionality... Does
    anyone knows how I can add a linkbutton to the datagrid that throws a
    specific event (ex. printcommand) ?

    Regards
    Roel
     
    Roel, May 24, 2004
    #1
    1. Advertising

  2. Roel

    mortb Guest

    Something like this:

    <asp:datagrid id="myGrid" runat="server">
    <Columns>
    <asp:BoundColumn DataField="ItemName" Visible="False" />
    <asp:ButtonColumn ItemStyle-VerticalAlign="Top"
    ButtonType="LinkButton" Text="Print..." CommandName="cmdPrint" />
    </Columns>
    </asp:datagrid>


    protected void gridModules_ItemCommand(object source,
    DataGridCommandEventArgs e)
    {
    if(e.CommandName == "cmdPrint")
    {
    //do your stuff
    }
    }

    cheers,
    mortb




    "Roel" <> wrote in message
    news:...
    > Hello,
    >
    > I built an application that shows the file of a folder on a website.
    >
    > I present it by using a datagrid. Now, I want to add some functionalities

    to
    > the datagrid like, the possibility to delete the file. Therefore I use the
    > deletecommand -event. But I also want to add print functionality... Does
    > anyone knows how I can add a linkbutton to the datagrid that throws a
    > specific event (ex. printcommand) ?
    >
    > Regards
    > Roel
    >
    >
     
    mortb, May 24, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dave
    Replies:
    0
    Views:
    909
  2. Anil
    Replies:
    2
    Views:
    476
    Srinivasan Venkataramanan
    Sep 9, 2005
  3. Ben Pfaff

    Re: man pages for C commands (GCC commands)

    Ben Pfaff, Jun 24, 2003, in forum: C Programming
    Replies:
    4
    Views:
    3,975
    Thomas Stegen
    Jun 28, 2003
  4. Tim Stanka
    Replies:
    1
    Views:
    805
    Jeff Epler
    Aug 2, 2004
  5. Andreas Klemt
    Replies:
    0
    Views:
    309
    Andreas Klemt
    Oct 8, 2003
Loading...

Share This Page