3

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.

3 Answers 3

3

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

Sign up to request clarification or add additional context in comments.

Comments

1

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/

Comments

-2

There is a easier way to do that, by simply creating in a partial class separated from the code generated by EF, with the atribute:

[DisplayColumn("columnName")]
public partial class Product{}

Hope it will be helpful for future references.

1 Comment

This is not the answer which asked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.