Configure ListView Dialog Box

The Configure ListView dialog box helps you configure a ListView control when you want to apply predefined layouts, styles, and options. This dialog box is a good way to provide content for the templates of the ListView control, because the control does not have auto-generate functionality.

To access this dialog box

  1. Switch to Design view.

  2. Right-click a ListView control and click Show Smart Tag.

    The smart tag panel is displayed.

  3. In the Choose Data Source list, select <New data source…>.

    The Data Source Configuration Wizard opens.

  4. Follow the steps to add a data source control.

    When the wizard finishes, a data source control is automatically created on the page. For more information about the wizard, see Data Source Configuration Wizard (Visual Web Developer).

  5. Right-click the ListView control and then click Show Smart Tag.

  6. In the smart tag panel, click Configure ListView … .

    The Configure ListView dialog box is displayed.

    Note

    The Configure ListView dialog box does not recognize the existing formatting of the control. As a result, every time that you open this dialog box, you must reconfigure the control. After you finish configuring the control, the properties, keys, and templates of the ListView control are reset. All the available templates are added with content to the ListView control, except for the GroupSeparatorTemplate and ItemSeparatorTemplate templates.

  • Select a Layout
    Sets the layout for the control. The following table lists available layouts.

    Layout name

    Description

    Grid

    The data is presented in a tabular layout. Every column corresponds to a field in the underlying data source. This layout includes a header row that uses field names for each column.

    Tiled

    The data is presented in a tiled tabular layout that uses the group template. Each item includes the name and value of all the fields. This layout automatically sets the GroupItemCount property to 3.

    Bulleted List

    The data is presented in a bulleted list. Each list item contains the name and value of all the fields.

    Flow

    The data is present in a flow layout that uses a div element. The items are displayed one after another and each item contains the name and value of all the fields.

    Single Row

    The data is presented in a table with only one row. The items are displayed in a column, one after another, and each item contains the name and value of all the fields.

  • Select a Style
    Specifies a style for the control. Select (No Formatting) to remove a previously set style.

  • Options
    Specifies the additional functionalities to the control. The following table lists available options.

    Option name

    Description

    Enable Editing

    Adds an Edit button to each data item. (An Edit button is a button control whose CommandName property is set to "Edit".) Clicking this button puts the item in edit mode to enable users to update the record. This option is available only when the underlying data source object is configured for update operations.

    Enable Inserting

    Adds an ItemTemplate template to the ListView control. The template includes text boxes for each field that is not an identity column, and Insert and Cancel buttons. This option is available only when the underlying data source object is configured for insert operations.

    Enable Deleting

    Adds a Delete button to each data item. (A Delete button is a button control whose CommandName property is set to "Delete".) Clicking this button deletes the record from the data source. This option is available only when the underlying data source object is configured for delete operations.

    Enable Paging

    Adds a DataPager control to the LayoutTemplate template of the ListView control. This enables paging functionality in the ListView control.

    You must select one the following pager layouts:

    • Next/Previous Pager

      Adds a NextPreviousPagerField object to the DataPager control. This enables users to navigate through pages of data one page at a time, or to jump to the first or last page of data.

    • Numeric Pager

      Adds a combination of NumericPagerField and NextPreviousPagerField objects to the DataPager control. This enables users to select a page of data by page number, or to jump to the first or last page of data.

  • Preview
    Displays an example of what the control will look like with the layout, style, and options applied. (The preview might not reflect the exact configuration of the control.)

See Also

Concepts

ListView Web Server Control Overview

Data Source Controls Overview