System.Web 2.0.0.0 System.Web.UI.WebControls.DataControlField The class is used by data-bound controls (such as and ) to display an image for each record displayed. The object is displayed differently depending on the data-bound control in which it is used. For example, the control displays an object as a column, while the control displays it as a row. To display images, you must bind an object to a field from a data source that contains the URL of an image. This is accomplished by setting the property. The URL value can be formatted by using the property. Each image can also have alternate text associated with it. This text is displayed when an image cannot be loaded, or is unavailable. Browsers that support the ToolTips feature also display this text as a ToolTip. You can specify the alternate text for a displayed image by using one of the following methods: Use the property to specify alternate text that applies to all images. Use the property to bind a field from a data source to the property of each image. This allows you to have different alternate text for each image displayed. When binding data, you can optionally format the alternate text by using the property. When the URL value for an image is null, an image cannot be displayed. You can display an alternate image for null field values by setting the property. Instead of an alternate image, you can display alternate text by setting the property. By default, all declared fields are displayed in a data-bound control. You can hide an object in a data-bound control by setting the property to false. You can customize the header and footer sections of an object. To display a caption in the header or footer section, 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 data-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 an image 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 an 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 Property System.ComponentModel.Localizable(true) System.ComponentModel.DefaultValue("") System.String To be added. Use the property to specify the alternate text for the images displayed in an object. The alternate text is displayed when an image cannot be loaded or is unavailable. Browsers that support the ToolTips feature also display this text as a ToolTip. When this property is set, all images displayed in an object share the same alternate text. As an alternative, you can bind the alternate text to a field in a data source by setting the property instead of this property. This allows you to have different alternate text for each image displayed. If both the and properties are 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 alternate text displayed for an image in the object. 2.0.0.0 Property System.ComponentModel.DefaultValue(true) System.Boolean To be added. Sometimes the user may enter an empty string for a field value when updating or inserting records. Use the property to specify whether an empty string value is automatically converted to null when the data field is updated in the data source The class displays null as empty strings by default. To display a different value, set the property. Gets or sets a value indicating whether empty string ("") values are converted to null when the field values are returned from the data source. 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 the class. 2.0.0.0 Property System.ComponentModel.DefaultValue("") System.ComponentModel.TypeConverter("System.Web.UI.Design.DataSourceViewSchemaConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") System.String To be added. Use the property to specify the name of the filed from the data source that contains the values to bind to the property of each image in an object. The enables you to have different alternate text for each image displayed. The alternate text is displayed when an image cannot be loaded or is unavailable. Browsers that support the ToolTips feature also display this text as a ToolTip. You can specify alternate text that applies to all images by setting the property instead of this property. If both the and properties are set, the field takes precedence. Gets or sets the name of the field from the data source that contains the values to bind to the property of each image in an object. 2.0.0.0 Property System.ComponentModel.DefaultValue("") System.String To be added. Use the property to specify a custom format for the alternate text values of the images displayed in an object. The format string is applied only when the property is set. It is not applied when the property is set. This is useful when you need to modify the original value contained in the field. If the property is not set, the alternate text values do not get any special formatting. The format string can be any literal string and usually contains a placeholder for the field's value. For example, in the format string "Item Value: {0}", the "{0}" placeholder is replaced with the value of the fields specified by the property. 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 {A:Bxx}. The value before the colon (A 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 (B 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 (xx 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 2 decimal places. For more information on formatting, see Formatting Overview. Gets or sets the string that specifies the format in which the alternate text for each image in an object is rendered. 2.0.0.0 Property System.ComponentModel.DefaultValue("") System.ComponentModel.TypeConverter("System.Web.UI.Design.DataSourceViewSchemaConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") System.String To be added. Use the property to specify the name of the field to bind to the property of each image in an object. The specified field must contain the URLs for the images to display in the object. You can optionally format the URL values by setting the property. When the filed value is null, an image cannot be displayed. You can display an alternate image for null field values by setting the property. Instead of an alternate image, you can display alternate text by setting the property. Gets or sets the name of the field from the data source that contains the values to bind to the property of each image in an 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 images displayed in an object. This is useful when you need to generate a URL, such as when the object simply contains the file name. If the property is not set, the URL values do not get any special formatting. The format string can be any literal string and usually contains a placeholder for the field's value. For example, in the format string "Item Value: {0}", the "{0}" placeholder is replaced with the value of the fields specified by the property. 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 {A:Bxx}. The value before the colon (A 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 (B 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 (xx 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 2 decimal places. For more information on formatting, see Formatting Overview. Gets or sets the string that specifies the format in which the URL for each image in an object is rendered. 2.0.0.0 Method System.Void The method is a helper method used to retrieve the values of the fields from the specified object in an object. This method is used primarily by control developers. This method does not have a return value. Instead, the field values are returned by reference through the object passed in for the parameter. After the method has been called, iterate through the object to access the field values. To include the read-only field values in the object, pass in true for the parameter. Fills the specified object with the values from the specified object. An used to store the values of the specified cell. The that contains the values to retrieve. One of the values. true to include the values of read-only fields; otherwise, false. 2.0.0.0 Method System.String To be added. The method is a helper method used by the class to apply the format specified by the property to a field value. Applies the format specified by the property to a field value. The transformed value. 2.0.0.0 Method System.String The method is a helper method used by the class to determine what value to display for a field when rendering an object in a designer. If real data cannot be retrieved from the data source at design time, the value returned by this method is displayed instead. Retrieves the value used for a field's value when rendering the object in a designer. The value to display in the designer as the field's value. 2.0.0.0 Method System.String The method is a helper method used by the class to apply the format specified by the property to the alternate text value. The alternate text value is contained in the object specified by the parameter. Applies the format specified by the property to the alternate text value contained in the specified object. The transformed value. The that contains the alternate text value to transform. 2.0.0.0 Method System.Object To be added. To be added. To be added. To be added. To be added. To be added. 2.0.0.0 Method System.Boolean To be added. The method is called by the data control with which the object is associated to perform basic object initialization for instances of the field, before the field is ever added to a field collection. Data controls such as and call the method in their CreateChildControls methods before other methods such as CreateRow are called to create specific rows with data. Call this method when you are writing a custom data-bound control that uses objects to perform basic initialization for an object. Implement this method if your -derived type requires any object initialization before it populates objects with data or controls in the method. Initializes the object. Always returns true. The data control that contains the . 2.0.0.0 Method System.Void The method is implemented by -derived types to add text and controls to a object of a data control that uses tables to display a user interface (UI). These data controls create the complete table structure row-by-row when the control's CreateChildControls method is called. The method is called by the InitializeRow method of data controls such as and . Call this method when you are writing a custom data-bound control that uses objects to initialize the cells of the table structure with data or controls. Implement this method when you are writing an -derived class. Initializes the specified object with the specified cell type, row state, and row index. The to initialize. One of the values. One of the values. The zero-based index of the row. 2.0.0.0 Method System.Void The method is a helper method used by the class to initialize a cell in an object. Initializes the specified object with the specified row state. The to initialize. One of the values. 2.0.0.0 Property System.ComponentModel.Localizable(true) System.ComponentModel.DefaultValue("") System.String To be added. When the value of the field specified by the property is null, an image cannot be displayed in an object. Use the property to specify the text to display in the image's place. The text usually indicates that the normal image is not available or cannot be found. As an alternative, you can display an alternate image when the field value is null by setting the property instead of this property. If the and properties are both set, the property has 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 in an object when the value of the field specified by the property is null. 2.0.0.0 Property System.Web.UI.UrlProperty System.ComponentModel.Editor("System.Web.UI.Design.ImageUrlEditor, 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. When the value of the field specified by the property is null, an image cannot be displayed in an object. Use the property to specify the URL to an alternate image to display. The alternate image is usually an image that indicates that the normal image is not available or cannot be found. As an alternative, you can simply display text when the field value is null by setting the property instead of this property. If the and properties are both set, the property has precedence. Gets or sets the URL to an alternate image displayed in an object when the value of the field specified by the property is null. 2.0.0.0 Method System.Void The method is a helper method used by the class to bind the value of a field in the data source to a corresponding cell in an object. Binds the value of a field to the object. The source of the event. An that contains the event data. 2.0.0.0 Property System.ComponentModel.DefaultValue(false) System.Boolean To be added. By default, the values of the field specified by the property can be modified by the user when a data-bound control is in edit mode. To prevent the user from changing the values of the field, set this property to true. In an object, the property usually contains the name of the field that contains the URLs to the images displayed in the object. Gets or sets a value indicating whether the values of the field specified by the property can be modified in edit mode. 2.0.0.0 Field System.String The field is use to indicate that the object should bind to the data source itself rather than a filed of the data source. In this case, the value returned by the object's method will be displayed in the field. Represents the "this" expression. 2.0.0.0 Method System.Void The method is a helper method used to determine whether the controls contained in an object support callbacks. This method has been implemented as an empty method (a method that does not contain any code) to indicate that callbacks are supported. This method is used primarily by control developers. Determines whether the controls contained in an object support callbacks. 2.0.0.0