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.
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.
Have a look at these samples on my blog: The Anatomy of a FieldTemplate. Your First FieldTemplate. An Advanced FieldTemplate. A Second Advanced FieldTemplate.
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/