DataRepeaterLayoutStyles Enumeration

Provides an enumeration for specifying the orientation of items in a DataRepeater control.

Namespace:  Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

public enum DataRepeaterLayoutStyles

Member nameDescription
VerticalDefault. Items will be displayed in a vertical format. A vertical scroll bar will be displayed as necessary.
HorizontalItems will be displayed in a horizontal format. A horizontal scroll bar will be displayed as necessary.

The DataRepeaterLayoutStyles enumeration is used by the LayoutStyle property of the DataRepeater control.

In most cases, you will have to add code in the LayoutStyleChanged event handler to rearrange the child controls when you change the orientation.

The following code example demonstrates how to toggle between vertical and horizontal layouts.

// Switch the orientation. 
if (dataRepeater1.LayoutStyle == DataRepeaterLayoutStyles.Vertical)
    dataRepeater1.LayoutStyle = DataRepeaterLayoutStyles.Horizontal;
    dataRepeater1.LayoutStyle = DataRepeaterLayoutStyles.Vertical;

Community Additions