Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Evaluate Expression ?
Message
General information
Forum:
ASP.NET
Category:
Other
Title:
Evaluate Expression ?
Miscellaneous
Thread ID:
00748567
Message ID:
00748567
Views:
44
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.
Next
Reply
Map
View

Click here to load this message in the networking platform