r_caine
08-11-2006, 03:10 AM
Hiya,
I'm having real problems programmatically adding BoundColumns to my GridView. All the documentation and examples I can find say to use the following syntax:
BoundColumn col = new BoundColumn();
col.DataField = "Title";
col.HeaderText = "Title";
grdItems.Columns.Add(col);
However, this just gives me the build errors:
The best overloaded method match for 'System.Web.UI.WebControls.DataControlFieldCollection.Add(System.Web.U I.WebControls.DataControlField)' has some invalid arguments
Argument '1': cannot convert from 'System.Web.UI.WebControls.BoundColumn' to 'System.Web.UI.WebControls.DataControlField'
Ideas?
Thanks!
I'm having real problems programmatically adding BoundColumns to my GridView. All the documentation and examples I can find say to use the following syntax:
BoundColumn col = new BoundColumn();
col.DataField = "Title";
col.HeaderText = "Title";
grdItems.Columns.Add(col);
However, this just gives me the build errors:
The best overloaded method match for 'System.Web.UI.WebControls.DataControlFieldCollection.Add(System.Web.U I.WebControls.DataControlField)' has some invalid arguments
Argument '1': cannot convert from 'System.Web.UI.WebControls.BoundColumn' to 'System.Web.UI.WebControls.DataControlField'
Ideas?
Thanks!