Q: datagrid header/footer

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
Is it possible to change a datagrid Header and Footer text in code behind
dynamically?
Thanks,
Jim.
 
Jim, at ItemDataBound you can get at header and footer, e.g. e.Item.ItemType
= ListItemType.Header. From there I'd use findcontrol to get the controls you
want to modify.

Bill
 
Jim, some good articles are here:

http://dotnetjunkies.com/tutorial/b8550e4b-b8f5-4446-b065-0b19f4c739bc.dcik
(Peter van Ooijen)
and here:
http://aspnet.4guysfromrolla.com/articles/040502-1.aspx (Scott Mitchell)

After you understand the basics, the rest of what you do where depends on a
few things. Come back with a few specifics--for one, are these template
columns, and for two, do you know what you want to change the header/footer
to *before* you load the data in the grid or not till *after*?

Bill
 
Thanks Bill for the reply.
My data grid works fine and I am doing edit/insert/delete kind of
things, that is way I am looking an easiest way to reach the footer of
a column and set a text there.

So I am looking something like
DataGrid1.Footer[ColumnName].Text="myText", is this possible?
 
Back
Top