How to manipulate DataGrid after binding?

goodmorningsky

Centurion
Joined
Aug 18, 2003
Messages
172
Hi, all
I bind DataTable to DataGrid from Page_Load event.

DataView dvw = ds.Tables[0].DefaultView;
this.dgColorDate.DataSource = dvw;
this.dgColorDate.DataBind();

And I want to hide certain column and add some control to cell.
When I try to do it from PreRender event handler.

this.dgColorDate.Columns[(int)Lst.MDL_MFG_COLOR_ID].Visible = false;
this.dgColorDate.Columns[(int)Lst.Colors].HeaderText = "Colors";

It throws error. When I check it in debug mode, dgColorDate.Column.Count returns 0.
How can I solve this?
 
Back
Top