GridView & Labels ?

Discussion in 'ASP .Net Web Controls' started by Mr. Murad Jamal, Jun 7, 2006.

  1. I have a GridView Control, I added a label to each cell,
    how can i access that label from Code Behind ?

    Thank you in advance !
    Mr. Murad Jamal, Jun 7, 2006
    #1
    1. Advertising

  2. Mr. Murad Jamal

    Jan Hyde Guest

    Mr. Murad Jamal <>'s
    wild thoughts were released on Wed, 7 Jun 2006 01:08:02
    -0700 bearing the following fruit:

    >I have a GridView Control, I added a label to each cell,
    >how can i access that label from Code Behind ?
    >
    >Thank you in advance !


    Are you talking about template fields columns?

    If so then RowDataBound event you can get at your label with
    code something like this

    Dim lbl As Label

    If e.Row.RowType = DataControlRowType.DataRow Then
    lbl = e.Row.FindControl("TheNameOfTheLabelIWant")
    Endif



    Jan Hyde (VB MVP)

    --
    Christmas is the time of year when mother has to separate the men from the toys.

    (Leopold Fechtner)
    Jan Hyde, Jun 7, 2006
    #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. Michael Kellogg
    Replies:
    0
    Views:
    863
    Michael Kellogg
    Apr 6, 2006
  2. =?Utf-8?B?bWdvbnphbGVzMw==?=

    GridView Hierarchical View - Gridview in Gridview

    =?Utf-8?B?bWdvbnphbGVzMw==?=, May 9, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    17,946
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    May 9, 2006
  3. =?Utf-8?B?TXIuIE11cmFkIEphbWFs?=

    GridView & Labels ?

    =?Utf-8?B?TXIuIE11cmFkIEphbWFs?=, Jun 7, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    492
    Jan Hyde
    Jun 7, 2006
  4. Keithb
    Replies:
    0
    Views:
    2,881
    Keithb
    Nov 4, 2006
  5. Luc
    Replies:
    3
    Views:
    1,424
    Gregory A. Beamer
    Sep 22, 2009
Loading...

Share This Page