System.Web
2.0.0.0
System.Web.UI.WebControls.DataControlField
The class is used by data-bound controls (such as and ) to display a hyperlink for each record displayed. When the user clicks a hyperlink, he or she is directed to the Web page associated with the hyperlink. The object is displayed differently depending on the data-bound control in which it is used. For example, the control displays a object as a column, while the control displays it as a row.
To specify the caption to display for the hyperlinks, use the property. Use the property to specify the URL to navigate to when a hyperlink is clicked. If you want to display the linked content in a specific window or frame, set the property.
When the and properties are set, all hyperlinks in the object share the same caption and navigation URL. Likewise, the property also applies to all hyperlinks.
Alternatively, you can bind the object to fields in a data source. This allows you to display a different caption for each hyperlink in the object and to have each hyperlink navigate to a different location. To bind a field to a caption, set the property. To create a URL for navigation, set the property to a comma-separated list of fields to use to create the URL.
You can specify a custom format for the captions and navigation URLs by setting the and properties, respectively.
You can hide a object in a data-bound control by setting the property to false.
You can customize the header and footer sections of a object. To display a caption in the header or footer sections, set the or properties, respectively. To display an image in the header section instead of text, set the property. The header section can be hidden in the object by setting the property to false.
Some data-bound controls (such as the control) can show or hide only the entire header section of the control. These data-bound controls do not support the property for an individual bound field. To show or hide the entire header section of a data-bound control, use the control's ShowHeader property (if available).
You also can customize the appearance of the object (font color, background color, and so on) by setting the style properties for the different parts of the field. The following table lists the different style properties.
-
Style property
Description
-
The style settings for the child Web server controls of the object.
-
The style settings for the footer section of the object.
-
The style settings for the header section of the object.
-
The style settings for the data items in the object.
Represents a field that is displayed as a hyperlink in a data-bound control.
Constructor
Use this constructor to initialize a new instance of the class. This constructor is commonly used when adding fields to a dynamically created data-bound control.
To dynamically add a object to a data-bound control, create a new object, set its properties, and then add it to the data-bound control's field collection. For example, if you are using the control, add the object to the collection.
Although you can dynamically add fields to a data-bound control, it is strongly recommended that fields be statically declared and then shown or hidden, as appropriate. Statically declaring all your fields reduces the size of the view state for the parent data-bound control.
Initializes a new instance of the class.
2.0.0.0
Method
System.Void
The method is called by the method to copy the properties of the current object to another.
Copies the properties of the current object to the specified object.
The -derived object that receives the copy.
2.0.0.0
Method
System.Web.UI.WebControls.DataControlField
The method is called by the method to create a new instance of the class.
Returns a new instance of the class.
A new instance of .
2.0.0.0
Property
System.ComponentModel.DefaultValue(null)
System.ComponentModel.TypeConverter(typeof(System.Web.UI.WebControls.StringArrayConverter))
System.ComponentModel.Editor("System.Web.UI.Design.WebControls.DataFieldEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
System.String[]
To be added.
Use the property when the data source contains multiple fields that must be combined to create the hyperlinks for the object. The fields specified in the property are combined with the format string in the property to construct the hyperlinks in the object.
When you set the property with declarative code in an .aspx file, use a comma-separated list of field names.
Instead of using this property to bind the URLs of the hyperlinks to a field, you can use the property to set the hyperlinks' URL to a static value. With this option, each hyperlink shares the same URL.
If the and the properties are both set, the property takes precedence.
Gets or sets the names of the fields from the data source used to construct the URLs for the hyperlinks in the object.
2.0.0.0
Property
System.ComponentModel.DefaultValue("")
System.String
To be added.
Use the property to specify a custom format for the URLs of the hyperlinks in a object. If the property is not set, the hyperlinks' URLs do not get any special formatting.
The format string is applied only when the property is set.
The format string can be any literal string and usually includes a placeholder for the field's value. For example, in the format string "Item Value: {0}", the {0} placeholder is replaced with the field's value in the object. The rest of the format string is displayed as literal text.
If the format string does not include a placeholder, the field's value from the data source is not included in the final display text.
The placeholder consists of two parts, separated by a colon and wrapped in braces, in the form {:}. The value before the colon ( in the general example) specifies the field value's index in a zero-based list of parameters.
This parameter is part of the formatting syntax. Because there is only one field value in each cell, this value can only be set to 0.
The colon and the values after the colon are optional. The character after the colon ( in the general example) specifies the format in which to display the value. The following table lists the common formats.
-
Format character
Description
-
C
Displays numeric values in currency format.
-
D
Displays numeric values in decimal format.
-
E
Displays numeric values in scientific (exponential) format.
-
F
Displays numeric values in fixed format.
-
G
Displays numeric values in general format.
-
N
Displays numeric values in number format.
-
X
Displays numeric values in hexadecimal format.
The format characters are not case-sensitive, except for X, which displays the hexadecimal characters in the case specified.
The value after the format character ( in the general example) specifies the number of significant digits or decimal places to display. For example, the format string "{0:F2}" displays a fixed-point number with two decimal places.
For more information on formatting strings, see Formatting Overview.
Gets or sets the string that specifies the format in which the URLs for the hyperlinks in a object are rendered.
2.0.0.0
Property
System.ComponentModel.TypeConverter("System.Web.UI.Design.DataSourceViewSchemaConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
System.ComponentModel.DefaultValue("")
System.String
To be added.
Use the property to specify the name of the field that contains the text to display for the hyperlink captions in the object.
Instead of using this property to bind the hyperlink captions to a field, you can use the property to set the hyperlink captions to a static value. With this option, each hyperlink shares the same caption.
If the and properties are both set, the property takes precedence.
Gets or sets the name of the field from the data source containing the text to display for the hyperlink captions in the object.
2.0.0.0
Property
System.ComponentModel.DefaultValue("")
System.String
To be added.
Use the property to specify a custom display format for the captions displayed in the object. If the property is not set, the field's value is displayed without any special formatting.
The format string is applied only when the property is set.
The format string can be any literal string and usually includes a placeholder for the field's value. For example, in the format string "Item Value: {0}", the {0} placeholder is replaced with the field's value when it is displayed in the object. The rest of the format string is displayed as literal text.
If the format string does not include a placeholder, the field's value from the data source is not included in the final display text.
The placeholder consists of two parts, separated by a colon and wrapped in braces, in the form {:}. The value before the colon ( in the general example) specifies the field value's index in a zero-based list of parameters.
This parameter is part of the formatting syntax. Because there is only one field value in each cell, this value can only be set to 0.
The colon and the values after the colon are optional. The character after the colon ( in the general example) specifies the format in which to display the value. The following table lists the common formats.
-
Format character
Description
-
C
Displays numeric values in currency format.
-
D
Displays numeric values in decimal format.
-
E
Displays numeric values in scientific (exponential) format.
-
F
Displays numeric values in fixed format.
-
G
Displays numeric values in general format.
-
N
Displays numeric values in number format.
-
X
Displays numeric values in hexadecimal format.
The format characters are not case-sensitive, except for X, which displays the hexadecimal characters in the case specified.
The value after the format character ( in the general example) specifies the number of significant digits or decimal places to display. For example, the format string "{0:F2}" displays a fixed-point number with two decimal places.
For more information on formatting strings, see Formatting Overview.
Get or sets the string that specifies the format in which the hyperlink captions in a object are displayed.
2.0.0.0
Method
System.String
The method is a helper method used to format the URL of a hyperlink in a object with the format string specified by the property.
Formats the navigation URL using the format string specified by the property.
The formatted URL value.
An array of values to combine with the format string.
2.0.0.0
Method
System.String
The method is a helper method used to format the caption text of a hyperlink in a object with the format string specified by the property.
This method is used primarily by control developers.
Formats the caption text using the format string specified by the property.
The formatted text value.
The text value to format.
2.0.0.0
Method
System.Boolean
To be added.
To be added.
Initializes the object.
Always returns false.
The data control that acts as the parent for the .
2.0.0.0
Method
System.Void
The method is called by the data-bound control that contains the object to initialize a control with the text and URL of the link.
Initializes a cell in a object.
A that contains the text or controls of the .
One of the values.
One of the values that specifies the state of the row containing the .
The index of the row in the table.
2.0.0.0
Property
System.Web.UI.UrlProperty
System.ComponentModel.Editor("System.Web.UI.Design.UrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
System.ComponentModel.DefaultValue("")
System.String
To be added.
Use the property to specify the URL to navigate to when a hyperlink in a object is clicked. When this property is set, each hyperlink shares the same navigation URL.
Instead of using this property to set the URL for the hyperlinks, you can use the property to bind the URLs of the hyperlinks to a field in a data source. This allows you to have a different URL for each hyperlink.
If the and properties are both set, the property takes precedence.
Gets or sets the URL to navigate to when a hyperlink in a object is clicked.
2.0.0.0
Property
System.ComponentModel.TypeConverter(typeof(System.Web.UI.WebControls.TargetConverter))
System.ComponentModel.DefaultValue("")
System.String
To be added.
Use the property to specify the window or frame in which to display the Web content linked to a hyperlink when that hyperlink is clicked.
Values must begin with a letter in the range of A through Z (case-insensitive), except for the special values listed in the following table, each of which begins with an underscore.
-
Value
Description
-
_blank
Renders the content in a new window without frames.
-
_parent
Renders the content in the immediate frameset parent.
-
_search
Renders the content in the search pane.
-
_self
Renders the content in the frame with focus.
-
_top
Renders the content in the full window without frames.
Check your browser documentation to determine whether the _search value is supported. For example, Microsoft Internet Explorer 5.0 and later versions support the _search target value.
The property is rendered as a target attribute. The target attribute on anchor elements is not allowed in the XHTML 1.1 document type definition. Do not set the property if the rendered output for the object must be XHTML 1.1-compliant. For more information, refer to the topic ASP.NET and XHTML Compliance.
When creating accessible Web pages, it is strongly recommended you avoid using the property to target another window. For more information, see ASP.NET Accessibility.
Gets or sets the target window or frame in which to display the Web page linked to when a hyperlink in a object is clicked.
2.0.0.0
Property
System.ComponentModel.DefaultValue("")
System.ComponentModel.Localizable(true)
System.String
To be added.
Use the property to specify the caption to display for the hyperlinks in a object. When this property is set, each hyperlink shares the same caption.
Instead of using this property to set the hyperlink captions, you can use the property to bind the hyperlink captions to a field in a data source. This allows you to display a different caption for each hyperlink.
If the and properties are both set, the property takes precedence.
The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see and ASP.NET Globalization and Localization.
Gets or sets the text to display for each hyperlink in the object.
2.0.0.0
Method
System.Void
The method overrides the default method to indicate that controls contained in the object support callbacks.
Indicates that the controls contained by the object support callbacks.
2.0.0.0