totals at the TOP?

G

Gary

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
 
A

Alvin Bruney [MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top