Get GridView Cell Value

Discussion in 'ASP .Net' started by Chris, Apr 5, 2006.

  1. Chris

    Chris Guest

    Hi,

    In ASP.NET 2005, I am using a gridview control. I have some Buttons in
    gridview for opening different forms. I use ROWCOMMAND event for
    retrieving the name of the button pressed.

    Can I retrieve from which row the button was pressed (ex.
    grv_reports.Rows(0).Cells(4).Text) ? I have the primarykey hidden in
    gridview columns and I want to send it as a parameter to the new form I
    will open.


    Protected Sub gridview_RowCommand(ByVal sender As Object, ByVal e As
    System.Web.UI.WebControls.GridViewCommandEventArgs) Handles
    grv_reports.RowCommand
    If e.CommandName = "Send" Then

    End If

    Thanks a lot.
     
    Chris, Apr 5, 2006
    #1
    1. Advertising

  2. Chris

    Jan Hyde Guest

    "Chris" <>'s wild thoughts were released on
    5 Apr 2006 06:54:08 -0700 bearing the following fruit:

    >Hi,
    >
    >In ASP.NET 2005, I am using a gridview control. I have some Buttons in
    >gridview for opening different forms. I use ROWCOMMAND event for
    >retrieving the name of the button pressed.
    >
    >Can I retrieve from which row the button was pressed (ex.
    >grv_reports.Rows(0).Cells(4).Text) ? I have the primarykey hidden in
    >gridview columns and I want to send it as a parameter to the new form I
    >will open.
    >
    >
    > Protected Sub gridview_RowCommand(ByVal sender As Object, ByVal e As
    >System.Web.UI.WebControls.GridViewCommandEventArgs) Handles
    >grv_reports.RowCommand
    > If e.CommandName = "Send" Then
    >
    > End If
    >
    >Thanks a lot.


    Take a look at the help file for

    "GridView.RowCommand Event"

    There is an example given there.





    Jan Hyde (VB MVP)

    --
    f u cn rd ths, u cn gt a gd jb n cmptr prgrmmng.
     
    Jan Hyde, Apr 6, 2006
    #2
    1. Advertising

  3. Chris

    Chris Guest

    Thanks a lot, Jan. Sometimes the property names are not very clear,
    like commandargument.
     
    Chris, Apr 7, 2006
    #3
  4. Chris

    Jan Hyde Guest

    "Chris" <>'s wild thoughts were released on
    6 Apr 2006 22:51:53 -0700 bearing the following fruit:

    >Thanks a lot, Jan. Sometimes the property names are not very clear,
    >like commandargument.


    I hear that ;-)

    I also find that the help often tells me there no help
    available so I go to the index and type the exact same thing
    and there is the very topic I need.



    Jan Hyde (VB MVP)

    --
    Divorce: Going through a change of wife. (Henny Youngman)
     
    Jan Hyde, Apr 7, 2006
    #4
  5. Chris

    imranwahabit

    Joined:
    May 21, 2009
    Messages:
    1
    hello bro i am mohammed imran working on asp.net,i am having task where i should change the gridview column values into multilanguage so can any one help me out,how to change the column values and wats the code of it,waiting for ur reply,
    MY emailid:
     
    imranwahabit, Jun 14, 2009
    #5
    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. G. Whiz

    Gridview: Get the value in the cell

    G. Whiz, Mar 1, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,965
    Ken Cox - Microsoft MVP
    Mar 1, 2006
  2. graphicsxp

    get value of a cell in a gridview

    graphicsxp, May 22, 2006, in forum: ASP .Net
    Replies:
    12
    Views:
    88,561
    brianguy16
    Feb 20, 2008
  3. Mike

    get cell value within gridview

    Mike, Oct 18, 2007, in forum: ASP .Net
    Replies:
    14
    Views:
    2,767
  4. RJ
    Replies:
    1
    Views:
    254
    Eliyahu Goldin
    Feb 17, 2005
  5. Dave Hewes

    How to get Gridview cell value on select?

    Dave Hewes, Feb 28, 2007, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    247
    Dave Hewes
    Feb 28, 2007
Loading...

Share This Page