Get GridView Bound Field value

Discussion in 'ASP .Net' started by shapper, Mar 9, 2007.

  1. shapper

    shapper Guest

    Hello,

    I have looping through a GridView rows as follows:

    For Each gvrLevel As GridViewRow In gvLevels.Rows
    ...
    Next gvrLevel

    How can I get the value of a BoundField named "Description" in each
    row?

    Thanks,

    Miguel
     
    shapper, Mar 9, 2007
    #1
    1. Advertising

  2. shapper

    shapper Guest

    On Mar 9, 2:07 pm, "shapper" <> wrote:
    > Hello,
    >
    > I have looping through a GridView rows as follows:
    >
    > For Each gvrLevel As GridViewRow In gvLevels.Rows
    > ...
    > Next gvrLevel
    >
    > How can I get the value of a BoundField named "Description" in each
    > row?
    >
    > Thanks,
    >
    > Miguel


    Hello,

    I was able to retrieve it using the following:
    gvrLevel.Cells(0).Text

    The problem is that the Bound Field of index 0 is just a primary key
    so I have its visibility set to false.
    So the expression gvrLevel.Cells(0).Text returns "".

    If I set visible to True the expression gvrLevel.Cells(0).Text will
    return the correct value.

    How can I get the value without needing to have a column visible?

    Thanks,
    Miguel
     
    shapper, Mar 9, 2007
    #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. Phillip Vong
    Replies:
    0
    Views:
    428
    Phillip Vong
    Jul 27, 2006
  2. Replies:
    2
    Views:
    7,748
  3. Chris Botha

    Gridview and bound field hidden

    Chris Botha, Mar 23, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    431
    Muhammad Naveed Yaseen
    Mar 23, 2007
  4. Sound
    Replies:
    2
    Views:
    481
    Randy Webb
    Sep 28, 2006
  5. jr
    Replies:
    3
    Views:
    477
Loading...

Share This Page