totals at the TOP?

Discussion in 'ASP .Net Datagrid Control' started by Gary, Feb 21, 2004.

  1. Gary

    Gary Guest

    Is there any way to get FooterText to show at the top of the grid instead of
    the bottom? We have hundreds of pages of grids that are almost always too
    tall to show on a page. Users are constantly scrolling down to the bottom
    to see the totals as soon as the page shows. I know I can crunch this out
    in code by putting a table on top of the grid and writing code to put the
    totals in the table but...

    Is there an easy way?
    Thanks,
    G
     
    Gary, Feb 21, 2004
    #1
    1. Advertising

  2. well the much easier way is to simply copy the footer item into row zero.
    well not actually into row zero but insert a new row at position zero in the
    dataset before you bind. consider
    DataSet ds = 'some query retrieved information'
    //create a new row
    DataRow dr = ds.tables[0].NewRow();
    for(int i = 0; i < ds.Tables[0].rows.count - 1; i++)
    dr = ds.Tables[0].compute("Sum([column header text goes
    here])",string.empty)).ToString()

    ds.tables[0].rows.addat(0,dr);
    DataGrid1.DataSource = ds;
    DataGrid1.DataBind();

    that will total each column add it to a new row and put the row at the top
    of the dataset, which will appear as row 1, the other rows are pushed down.
    you should be able to tell that this code came off the top of my head so it
    won't compile, but the idea is sound.
    --
    Regards,
    Alvin Bruney [ASP.NET MVP]
    Got tidbits? Get it here...
    http://tinyurl.com/3he3b
    "Gary" <> wrote in message
    news:ef9yeAK%...
    > Is there any way to get FooterText to show at the top of the grid instead

    of
    > the bottom? We have hundreds of pages of grids that are almost always too
    > tall to show on a page. Users are constantly scrolling down to the bottom
    > to see the totals as soon as the page shows. I know I can crunch this out
    > in code by putting a table on top of the grid and writing code to put the
    > totals in the table but...
    >
    > Is there an easy way?
    > Thanks,
    > G
    >
    >
     
    Alvin Bruney [MVP], Feb 22, 2004
    #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. Gary
    Replies:
    4
    Views:
    1,368
    Yan-Hong Huang[MSFT]
    Feb 24, 2004
  2. Frederic HOUDE
    Replies:
    4
    Views:
    599
    Frederic HOUDE
    Aug 31, 2004
  3. =?Utf-8?B?Um9iZXJ0IENoYXBtYW4=?=

    Running totals in gridview (when you have many totals required)

    =?Utf-8?B?Um9iZXJ0IENoYXBtYW4=?=, Feb 15, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    865
    Alexey Smirnov
    Feb 16, 2007
  4. Cuthbert
    Replies:
    8
    Views:
    437
    Ancient_Hacker
    Sep 13, 2006
  5. AAaron123
    Replies:
    6
    Views:
    577
    AAaron123
    Nov 5, 2009
Loading...

Share This Page