for ( int colCounter = 0 ; colCounter < tableCrossRef.Columns.Count ; colCounter++ ) { string colName = "col" + (tableCrossRef.Columns[colCounter].ColumnName); TemplateColumn (colName) = new TemplateColumn(); }Which gives the error
(52): 'System.Web.UI.WebControls.TemplateColumn' denotes a 'class' which is not valid in the given contextI am trying to build a datagrid in the codebehind and I never know the names of the columns,so I can't just hardcode a template.