Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Evaluate Expression ?
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00748567
Message ID:
00748596
Views:
12
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.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Reply
Map
View

Click here to load this message in the networking platform