DynamicControl::DataField Property
Gets or sets the name of the data field that the DynamicControl control is bound to.
Assembly: System.Web.DynamicData (in System.Web.DynamicData.dll)
<asp:DynamicControl DataField="String" />
Property Value
Type: System::StringThe name of the data field to bind the DynamicControl control to. The default is an empty string (""), which indicates that this property is not set.
Use the DataField property to specify the data field to bind to the DynamicControl control. The data field can be the column name or, for foreign key columns, the relationship name.
By default, the specified data field is displayed by the DynamicControl control using the field template that is associated with the field data type. You can change the field template that is rendered for the data field by setting the UIHint property. You can also format the displayed text by setting the DataFormatString property.
Note If you want to change the display and behavior of a data field globally, you must apply attributes to your data model instead of setting this in a particular instance of the DynamicControl control. For more information, see ASP.NET Dynamic Data Overview
The following example demonstrates how to use the DataField property to specify which field to display in a DynamicControl control.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.