Here is an article that discusses how to create dynamic ASP.NET Server Controls using XML. You might find the content useful for your purposes:
http://www.dnzone.com/ShowDetail.asp?NewsId=151>In VFP, it's easy to use the Eval() statement to get at an object named on-the-fly. How is this done with C#?
>
>For example, in an ASP.NET code-behind I have
>
>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 context
>
>
>I 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.
>
>Anyone?
>
>Thanks.
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi