Dela via


How to: Display Unbound Controls in a DataRepeater Control (Visual Studio)

In addition to bound controls, you may want to add other controls to a DataRepeater, such as a static label or an image that is repeated on each item in the DataRepeater control.

Note

You must also have at least one bound control on the DataRepeater or nothing will be displayed at run time.

To add unbound controls to a DataRepeater

  1. Drag a DataRepeater control from the Visual Basic PowerPacks tab in the Toolbox to a form or container control.

  2. Drag the sizing and position handles to size and position the control.

    You can also size and position the control by changing the Size and Position properties in the Properties window.

  3. Add at least one data-bound control to the DataRepeater control. For more information, see How to: Display Bound Data in a DataRepeater Control (Visual Studio).

  4. Drag a control from the Toolbox onto the item template region of the DataRepeater control.

    Note that the control has two rectangular regions. The inner region is the item template; controls added to the template will be repeated in each item in the DataRepeater control at run time. The outer region is the viewport, where the items will be displayed; controls that are added to this region will not be displayed at run time.

See Also

Tasks

Troubleshooting the DataRepeater Control (Visual Studio)

How to: Display Bound Data in a DataRepeater Control (Visual Studio)

How to: Create a Master/Detail Form by Using Two DataRepeater Controls (Visual Studio)

How to: Change the Appearance of a DataRepeater Control (Visual Studio)

Reference

DataRepeater

Concepts

Introduction to the DataRepeater Control (Visual Studio)