Updated: July 2008
Specifies the template or user-defined control Dynamic Data uses to display a data field.
Assembly: System.ComponentModel.DataAnnotations (in System.ComponentModel.DataAnnotations.dll)
Dynamic Data uses the class to associate a user defined control with a data field. Dynamic Data uses UIHint property to determine the user-defined control to use to display a data field.
The following examples demonstrate how to add the UIHint property to a DynamicField field of a GridView control. The property is set to use a custom field template DateCalendar to displays a Calendar control for editing the DiscontinuedDate field of the Product table in the AdventureWorksLT database.
The following code snippet shows the page that uses the custom field template.
The following code snippet shows the code behind the custom field template.
The following code snippet shows the custom field template.
To compile the example code, you need the following:
Visual Studio 2008 Service Pack 1 or Visual Developer 2008 Express Edition Service Pack 1.
The AdventureWorksLT sample database. For information about how to download and install the SQL Server sample database, see Microsoft SQL Server Product Samples: Database on the CodePlex site. Make sure that you install the correct version of the sample database for the version of SQL Server that you are running (SQL Server 2005 or SQL Server 2008).
A Dynamic Data Web site. This enables you to create a data context for the database and the class that contains the data field to customize and the methods to override. In addition, it creates the environment in which to use the page described before. For more information, see Walkthrough: Creating a New ASP.NET Dynamic Data Web Site Using Scaffolding.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.