Reference GridView?

Discussion in 'ASP .Net' started by staeri@gmail.com, Feb 15, 2006.

  1. Guest

    I want to count the rows in a GridView which is nested into a DataList
    but I can't find the correct syntax for this.

    Can someone please help me with this and also tell me how to reference
    a text box control in the nested grid?

    Regards,

    Staeri
     
    , Feb 15, 2006
    #1
    1. Advertising

  2. Teemu Keiski Guest

    Hi,

    you could for example iterate the DataList

    'Iterate every item in DataList
    For each litem As DataListItem in DataList.Items

    Dim gw As GridView = DirectCast(litem.FindControl("GridView1"),GridView)
    'Count is gw.Items.Count

    Next

    Getting at TB inside GridView is similar task, you'd need to run FindControl
    against GridViewRow(s)

    --
    Teemu Keiski
    ASP.NET MVP, AspInsider
    Finland, EU
    http://blogs.aspadvice.com/joteke


    <> wrote in message
    news:...
    >I want to count the rows in a GridView which is nested into a DataList
    > but I can't find the correct syntax for this.
    >
    > Can someone please help me with this and also tell me how to reference
    > a text box control in the nested grid?
    >
    > Regards,
    >
    > Staeri
    >
     
    Teemu Keiski, Feb 15, 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. Darren
    Replies:
    0
    Views:
    501
    Darren
    Oct 11, 2004
  2. Dude
    Replies:
    0
    Views:
    357
  3. ce
    Replies:
    1
    Views:
    2,997
  4. =?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,985
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    May 9, 2006
  5. sam pal
    Replies:
    3
    Views:
    551
    E. Robert Tisdale
    Jul 16, 2003
Loading...

Share This Page