UIHint Property

DynamicField::UIHint Property


Gets or sets the field template to use for displaying the data field.

Namespace:   System.Web.DynamicData
Assembly:  System.Web.DynamicData (in System.Web.DynamicData.dll)

property String^ UIHint {
	virtual String^ get();
	virtual void set(String^ value);

Property Value

Type: System::String^

The name of the field template to use for displaying the data field.

Use the UIHint property to specify the field template to use to display the UI for a data field. Field templates by default are user controls and their names contain a suffix to identify field templates that are used for edit operations and insert operations. The suffixes are _edit and _insert, respectively. When you set a value to the UIHint property, you set the name without the suffixes. Dynamic Data will identify the current mode of the data field and will render the correct field template.

If the UIHint property is not set, Dynamic Data by default will render the field template based on the field type. For more information, see ASP.NET Dynamic Data Scaffolding.

The field template that you specify using the UIHint property is specific to this instance of the DynamicField class. You can also change the field template used by a data field across the entire application by applying the UIHintAttribute to your data model. Setting the UIHint property overrides the metadata applied to the data model. For more information about metadata attributes, see ASP.NET Dynamic Data.

The OnFieldChanged method is called to raise a state change event when the UIHint property is set.

The value of the UIHint property is stored in view state.

.NET Framework
Available since 3.5
Return to top
© 2015 Microsoft