rowcount

Discussion in 'ASP .Net Datagrid Control' started by et, Sep 22, 2005.

  1. et

    et Guest

    How can I get a count of rows in a datagrid?
     
    et, Sep 22, 2005
    #1
    1. Advertising

  2. et

    Jack Li Guest

    You may want to use:
    DataTable.Rows.Count

    Regards,
    Jack Li
    MVP (ASP.NET)

    "et" <> wrote in message
    news:...
    > How can I get a count of rows in a datagrid?
    >
     
    Jack Li, Sep 22, 2005
    #2
    1. Advertising

  3. et

    Elton Wang Guest

    datagrid.Items.Count


    HTH


    "et" <> wrote in message
    news:...
    > How can I get a count of rows in a datagrid?
    >
    >
     
    Elton Wang, Sep 22, 2005
    #3
  4. Jack Li wrote:
    > You may want to use:
    > DataTable.Rows.Count


    This assumes that you are binding a DataTable to a DataGrid. But if
    you're binding a DataReader this approach won't work. (If you're
    binding an Array or other collection, you can use similar code - just
    utilize the Count property.)

    A more flexible approach is, *after* you bind the data to the DataGrid,
    check out the DataGridID.Items.Count property.

    hth


    > Regards,
    > Jack Li
    > MVP (ASP.NET)
    >
    > "et" <> wrote in message
    > news:...
    >
    >>How can I get a count of rows in a datagrid?
    >>

    >
    >
    >



    --

    Scott Mitchell [ASP.NET MVP]

    http://www.4GuysFromRolla.com/ScottMitchell
     
    Scott Mitchell [MVP], Sep 23, 2005
    #4
    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. robert madrian

    ODS + TableAdapter + Rowcount

    robert madrian, Dec 19, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    409
    robert madrian
    Dec 19, 2005
  2. Replies:
    1
    Views:
    306
    =?ISO-8859-1?Q?Gerhard_H=E4ring?=
    Nov 14, 2005
  3. Jon Haakon Ariansen

    SqlDataReader - ReturnValue - rowcount

    Jon Haakon Ariansen, Nov 8, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    1,976
    bruce barker \(sqlwork.com\)
    Nov 8, 2006
  4. segue

    getting rowcount

    segue, Jan 23, 2008, in forum: ASP .Net
    Replies:
    4
    Views:
    789
    segue
    Jan 23, 2008
  5. Darrel
    Replies:
    2
    Views:
    2,525
    Darrel
    Dec 29, 2008
Loading...

Share This Page