Set Column Headertext

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

Guest

Hi
I have a Datagrid with a templatecolumn, where I add at design time. I also checked the "create columns automatically"
I would like to change the headertext of columns created automatically, but i don't know in which event I can do that

Can you help me

P.S. I tryied to set the headertext in the "PreRender" event of the DataGrid, but in this point the grid has still only the templatecolumn, and the others columns aren't created yet

Thank you
Alessandro Ross
 
Hi, Alessandro Rossi,

If you extend the DataGrid class (inherit from it) the best place is the
OnDataBinding protected method. You should first call base.OnDataBinding(e);
of course.

If you are simply using the DataGrid class - set the headertexts after you
call DataBind() because the columns are in fact created with this call.

Hope this helps
Martin
Alessandro Rossi said:
Hi,
I have a Datagrid with a templatecolumn, where I add at design time. I
also checked the "create columns automatically".
I would like to change the headertext of columns created automatically,
but i don't know in which event I can do that.
Can you help me?

P.S. I tryied to set the headertext in the "PreRender" event of the
DataGrid, but in this point the grid has still only the templatecolumn, and
the others columns aren't created yet.
 
Back
Top