LayoutStyle Property

DataRepeater.LayoutStyle Property


Gets or sets a value that determines whether a DataRepeater control will be displayed with a vertical or horizontal orientation.

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

public DataRepeaterLayoutStyles LayoutStyle { get; set; }

Property Value

Type: Microsoft.VisualBasic.PowerPacks.DataRepeaterLayoutStyles

One of the enumeration values that specifies the layout.

The LayoutStyle property of a DataRepeater control determines whether DataRepeater items are displayed in a vertical or a horizontal format. When this property changes, you can use the LayoutStyleChanged event handler and the BeginResetItemTemplate and EndResetItemTemplate methods to rearrange the child controls in the ItemTemplate to fit the new layout.

The following example shows how to respond to the LayoutStyleChanged event in an event handler. This example requires that you have a DataRepeater control named DataRepeater1 on a form and that it contain two TextBox controls named TextBox1 and TextBox2.

// Switch the orientation.
if (dataRepeater1.LayoutStyle == DataRepeaterLayoutStyles.Vertical)
    dataRepeater1.LayoutStyle = DataRepeaterLayoutStyles.Horizontal;
    dataRepeater1.LayoutStyle = DataRepeaterLayoutStyles.Vertical;
Return to top
© 2015 Microsoft