datagrid footer question

M

mark

im keeping running totals of certain columns in a datagrid, id like to put
these totals in the footer - how do i do this ? or how can i put a label
into the footer ? (im displaying results using labels instead at the moment)
eg

Label5.Text = "Column 1 Total:- " & mordraw & " (Ratio " &
FormatNumber(ddpercent, 2) & "%)"

id like that putting in the column1 footer if possible
thanks
mark
 
A

Alvin Bruney [MVP]

in your itemdatabound event handler:
if(e.item.listtype == listtype.footer)
{
e.item.cells[2].text = "some total";
}

roughly (meaning it won't compile but this is the general idea)
 
M

mark

Alvin Bruney said:
in your itemdatabound event handler:
if(e.item.listtype == listtype.footer)
{
e.item.cells[2].text = "some total";
}

roughly (meaning it won't compile but this is the general idea)
--

problem is i dont have an event handler - the datagrid is created on runtime
(its a report)
 
A

Alvin Bruney [MVP]

you will need to dynamically wire in an event handler then.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
mark said:
Alvin Bruney said:
in your itemdatabound event handler:
if(e.item.listtype == listtype.footer)
{
e.item.cells[2].text = "some total";
}

roughly (meaning it won't compile but this is the general idea)
--

problem is i dont have an event handler - the datagrid is created on
runtime
(its a report)
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top