If you add any controls inside datagrid (either in footer or header). it will
be placed under controls collection of datagrid. So if you try to directly
access the control, you will get error like this. If you want to set some
value to that label or if you want to access that label. then you need to do
this
datagriditem.findcontrol("Labelname")
Check out this article for more info,
http://www.extremeexperts.com/Net/Ar...stoFooter.aspx
"Justin" wrote:
> I am trying to figure out how to display the sum total of a numeric column in
> the footer of a datagrid. I have tried putting a label control in the footer
> of a column but for some reason when I try to reference the label control
> using:
>
> txtTotalDollars.Text = ttlDollars.ToString();
>
> I get an error saying that the label control txtTotalDollars does not exist.
> Note that when I place the label outside of the footer it works fine.
>
> Any ideas?
>
> Thanks, Justin.