views:

1860

answers:

2

Hi, I have an ASP.NET dynamic data site and for one of the text fields within Edit and Insert templates I'd like to covert it to dropdown and populate that drop down programmatically. Can you help or point into right direction ?

Thanks.

+2  A: 

Have a look at these samples on my blog: The Anatomy of a FieldTemplate. Your First FieldTemplate. An Advanced FieldTemplate. A Second Advanced FieldTemplate.

Wizzard
thank you, i'll take a look
McLovin
+1  A: 

What you will need to do is create a Custom FieldTemplate and use the UIHint Attribute on the column/property to direct ASP.NET Dynamic Data to use that Custom FieldTemplate in Insert and Edit mode.

see here: http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.uihintattribute.aspx

and here: http://www.asp.net/learn/3.5-SP1/

Aaron Hoffman

related questions