Export (0) Print
Expand All

DataRepeaterLayoutStyles Enumeration

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

Namespace:  Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks (in Microsoft.VisualBasic.PowerPacks.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.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e _
 As System.EventArgs) Handles Button1.Click
    If DataRepeater1.LayoutStyle = _
 PowerPacks.DataRepeaterLayoutStyles.Vertical Then
       ' Change the layout to horizontal.
       DataRepeater1.LayoutStyle = _
 PowerPacks.DataRepeaterLayoutStyles.Horizontal
       ' Add code here to resize the ItemTemplate 
       ' and/or child controls.
    Else
        ' Change the layout to vertical.
        DataRepeater1.LayoutStyle = _
 PowerPacks.DataRepeaterLayoutStyles.Vertical
        ' Add code here to resize the ItemTemplate 
        ' and/or child controls.
    End If
End Sub

Concepts

How to: Change the Appearance of a DataRepeater at Run Time

Reference

Community Additions

ADD
Show:
© 2014 Microsoft