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. Advertising

  2. Hello eagle,

    > 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
    >



    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. Advertising

  3. eagle

    eagle Guest

    Thanks! That works!

    "martin marinov" <> wrote in message
    news:...
    > Hello eagle,
    >
    >> 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
    >>

    >
    >
    > 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
    > Martin
    >
    >
    eagle, Jul 12, 2007
    #3
    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. Roger
    Replies:
    1
    Views:
    628
    GreggTB
    May 20, 2005
  2. =?Utf-8?B?QmVu?=

    Image Buttons/Buttons not responding

    =?Utf-8?B?QmVu?=, Jul 6, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    443
    Teemu Keiski
    Jul 6, 2005
  3. Jeremy Jones

    Datagrid Nav buttons and numeric buttons

    Jeremy Jones, Mar 21, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    615
    Masudur
    Mar 22, 2007
  4. Jonathan N. Little
    Replies:
    3
    Views:
    521
    Andy Dingley
    Apr 2, 2007
  5. Dr. Leff
    Replies:
    3
    Views:
    290
    David Mark
    Oct 15, 2007
Loading...

Share This Page