Determine GridView's total rows in Row DataBound event?

Discussion in 'ASP .Net' started by Craig Buchanan, Sep 29, 2008.

  1. Is there a way to determine the total number of records that will be bound to a
    GridView during the row's dataBound event? considering all of the types of data
    objects that can be bound to the gridView, there doesn't seem to be a consistent
    way to test the data source.

    Insights appreciated.

    Craig Buchanan
     
    Craig Buchanan, Sep 29, 2008
    #1
    1. Advertising

  2. Craig Buchanan

    Reggie Guest

    Craig, Maybe something like:

    dvwData = dstData.Tables(strView).DefaultView
    dgrdData.DataSource = dvwData
    intRowCount = dstData.Tables(0).Rows.Count

    Hope it helps

    Reggie

    "Craig Buchanan" <> wrote in message
    news:...
    > Is there a way to determine the total number of records that will be bound
    > to a GridView during the row's dataBound event? considering all of the
    > types of data objects that can be bound to the gridView, there doesn't
    > seem to be a consistent way to test the data source.
    >
    > Insights appreciated.
    >
    > Craig Buchanan
     
    Reggie, Oct 2, 2008
    #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. Replies:
    5
    Views:
    665
  2. rodchar
    Replies:
    0
    Views:
    395
    rodchar
    Nov 26, 2007
  3. yonialhadeff

    Group By Rows and Total Rows

    yonialhadeff, Jan 23, 2007, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    849
    Eliyahu Goldin
    Jan 23, 2007
  4. Darren Carter
    Replies:
    0
    Views:
    501
    Darren Carter
    Jan 22, 2006
  5. Manu
    Replies:
    0
    Views:
    170
Loading...

Share This Page