Gridview returns old value of gridview.rows.count!

Discussion in 'ASP .Net' started by MC, Apr 26, 2006.

  1. MC

    MC Guest

    I have a label that shows the number of records returned by my
    gridview. So after gridview ondatabound event I check to see if the
    gridview.rows.count > 0, and if true then show row count in label but
    empty gridviews my label shows an old row count of the previous
    gridview. What can I do to get the current row count?

    Thanx in advanx.
     
    MC, Apr 26, 2006
    #1
    1. Advertising

  2. MC

    MC Guest

    Never mind... I realized that I had a condition which didn't clear the
    label if the gridview returned 0 count.
    Is associating the label to the ondatabound event the best way to show
    row count? Any other/better ways?
    Thanx.
     
    MC, Apr 26, 2006
    #2
    1. Advertising

  3. MC

    sqda

    Joined:
    Dec 12, 2008
    Messages:
    1
    Easiest Way

    if you are using select method you can use:

    DataView dv = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);
    TextBox1.Text = dv.Table.Rows.Count.toString() + " registro(s) encontrado(s).";
     
    sqda, Dec 12, 2008
    #3
    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. GridView returns 0 rows

    , Aug 10, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    359
  2. trint
    Replies:
    2
    Views:
    1,122
    trint
    Sep 5, 2007
  3. VijayRama
    Replies:
    2
    Views:
    2,333
    Gregory A. Beamer
    Oct 12, 2009
  4. MC

    Gridview returns old value of gridview.rows.count!

    MC, Apr 26, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    328
  5. Diana
    Replies:
    1
    Views:
    135
    Diana
    Apr 6, 2004
Loading...

Share This Page