DataBindings Dialog Box

Displays a list of properties for the control and enables you to specify the data source that properties are bound to. Use the DataBindings dialog box to bind single-value properties (such as the BackColor or Width properties) to the control.

Note

This dialog box is not used to specify the list of records or objects to be displayed by multi-record controls, such as the Repeater, DataList, DataGrid, ListBox, CheckBoxList, and RadioButtonList controls. To specify what records those controls should display, configure a data source or set their DataSource and DataMember properties.

The DataBindings dialog box helps you create a data-binding expression that specifies what a property is bound to. You can make selections from a list of available data sources, which creates the data-binding expression for you. Alternatively, you can create a custom expression.

To open the DataBindings dialog box

  1. In Visual Web Developer, create or open an existing .aspx page and then switch to Design view.

  2. From the Data tab of the Toolbox, drag a DataList or FormView control onto the page.

  3. Right-click the control and click Show Smart Tag.

    The Tasks window is displayed for the control.

  4. Configure a data source for the control. The DataBindings dialog box is not available unless a data source is configured. For more information, see ASP.NET Data Access.

  5. In the Tasks window for the control, click Edit Templates.

    The Tasks window switches to Template Editing Mode.

  6. In the Display drop-down list, select ItemTemplate.

    The ItemTemplate designer is displayed in the control with three editable fields: Description, Title, and URL.

  7. Right-click any of the editable fields and click Show Smart Tag.

    The Label Tasks window is displayed.

  8. Click Edit DataBindings.

Tasks

UI Elements

  • Bindable properties
    Displays a list of all of the properties for the selected control that can be bound to a data source. If a property has already been bound, a data-binding glyph ( PropertiesWindowDatabindingSymbol screenshot ) appears next to the property name.

  • Field binding
    Indicates that you want to bind to an available data source. When this option is selected, the Bound to drop-down list of data items is enabled, and you can select an item to bind to.

    When you select an item to bind to, a data-binding expression is generated. It is displayed in the Code expression box, even though that box is disabled.

  • Format
    Enables you to select a string format specifier to use for formatting property values. Format specifiers are added into the data binding expression.

  • Sample
    Displays sample data with the format option applied.

  • Custom binding
    Indicates that you want to edit the data-binding expression. The Code expression editing box is enabled, and you can create a new expression or edit the one generated by the dialog box. For more information, see Data-Binding Expressions Overview.

    Note

    The dialog box does not check that the expression you create is valid.

See Also

Reference

Data Source Configuration Wizard (Visual Web Developer)

Concepts

Data-Binding Expressions Overview

Other Resources

ASP.NET Data Access