goodmorningsky Posted May 11, 2005 Posted May 11, 2005 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? Quote Sun Certified Web component Developer, Microsoft Certified Solution Developer .NET, Software Engineer
Moderators Robby Posted May 11, 2005 Moderators Posted May 11, 2005 You need to do this after your dg is bound. Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.