Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > datagrid footer question

Reply
Thread Tools

datagrid footer question

 
 
mark
Guest
Posts: n/a
 
      09-06-2004
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


 
Reply With Quote
 
 
 
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      09-07-2004
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)
--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"mark" <(E-Mail Removed)> wrote in message
news:5MU_c.414$(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
mark
Guest
Posts: n/a
 
      09-08-2004

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:(E-Mail Removed)...
> 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)


 
Reply With Quote
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      09-08-2004
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" <(E-Mail Removed)> wrote in message
newsSy%c.13$(E-Mail Removed)...
>
> "Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
> news:(E-Mail Removed)...
>> 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)
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGrid Header and Footer Question stephen ASP .Net 1 08-16-2006 09:20 AM
Any way to reorder how a datagrid is drawn (header/footer/items vs.header/items/footer)? Henrik ASP .Net Datagrid Control 1 07-06-2006 12:23 AM
Datagrid FindControl in Footer Dave ASP .Net 2 11-14-2003 04:11 PM
remove a control from a datagrid footer Darren Spooner ASP .Net 1 10-15-2003 01:13 AM
DataGrid: how to have a footer row dynamically sum data Roger Moore ASP .Net 0 07-07-2003 05:27 PM



Advertisments