using buttons in a gridview

Discussion in 'ASP .Net Datagrid Control' started by eagle, Jul 9, 2007.

  1. eagle

    eagle Guest

    In the following article, it says to have a button ina gridview, you need
    to capture the ItemCommand event. Well, there is no ItemCommand event in
    the gridview. So I use the RowCommand. The Article says to use the
    e.item.itemindex to determine the row that was selected, well the RowCommand
    has no e.item.itemindex proeprty. So how am I supposed to put a button in a
    gridview.

    http://msdn2.microsoft.com/en-us/library/df6hth3s(vs.80).aspx
     
    eagle, Jul 9, 2007
    #1
    1. Advertisements

  2. Hello eagle,

    Yes you are correct that in the GridViewCommandEventArgs class there is no
    index of the row. Fo this purpose you can follow the sample of this article
    that describes how you can handle the index of the row:
    http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowcommand.aspx

    Regards
    Marti
     
    martin marinov, Jul 10, 2007
    #2
    1. Advertisements

  3. eagle

    eagle Guest

    eagle, Jul 12, 2007
    #3
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.