ClassIntegralScrollWrapPanel
A specialized wrap layout panel that provides integral scrolling capabilities with precise line-based navigation.
Definition
Namespace:Telerik.WinControls.Layout
Assembly:Telerik.WinControls.dll
Syntax:
public class IntegralScrollWrapPanel : WrapLayoutPanel, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode
Inheritance: objectDisposableObjectRadObjectRadElementLayoutPanelWrapLayoutPanelIntegralScrollWrapPanel
Implements:
Inherited Members
Constructors
IntegralScrollWrapPanel()
Declaration
public IntegralScrollWrapPanel()
Properties
CurrentLine
which is the current line
LineCount
Gets the total number of lines in the layout after the most recent measurement pass.
Declaration
public int LineCount { get; }
Property Value
An integer representing the total number of lines required to display all child elements, or -1 if the layout has not been measured yet.
Remarks
This property is calculated during the layout measurement process and reflects the total number of horizontal or vertical lines (depending on orientation) needed to accommodate all child elements within the current layout constraints.
The line count is essential for implementing scrolling logic and determining the scroll range for the panel. It's automatically updated whenever the layout is invalidated and re-measured.
MaxColumns
Gets or sets the maximum number of columns that should be displayed in the visible area of the panel.
Declaration
public int MaxColumns { get; set; }
Property Value
An integer representing the maximum number of columns to display. The default value is MaxValue.
Remarks
This property controls the horizontal constraint for the layout, determining how many columns of elements can be displayed before wrapping to a new line. When combined with MaxRows, it defines the visible viewport for the content.
Setting this property triggers layout invalidation and forces a complete re-measurement and arrangement of all child elements. The control is also invalidated to ensure visual consistency.
This is particularly useful in gallery and grid scenarios where you want to control the number of items visible horizontally while allowing vertical scrolling through additional rows.
MaxRows
Gets or sets the maximum number of rows that should be displayed in the visible area of the panel.
Declaration
public int MaxRows { get; set; }
Property Value
An integer representing the maximum number of rows to display. The default value is 2.
Remarks
This property controls the vertical constraint for the layout, determining how many rows of elements can be displayed simultaneously. When combined with MaxColumns, it defines the visible viewport dimensions for the content.
Setting this property triggers layout invalidation and forces a complete re-measurement and arrangement of all child elements. The control is also invalidated to ensure visual consistency.
This is essential for implementing scrollable galleries and grids where you want to limit the vertical space while providing horizontal scrolling or navigation through additional content.
Methods
ArrangeOverride(SizeF)
Positions and sizes all child elements within the final layout area, implementing the wrapping and alignment behavior based on the current panel configuration.
Declaration
protected override SizeF ArrangeOverride(SizeF finalSize)
Parameters
finalSize
The final area within the parent that the panel should use to arrange itself and its children.
Returns
The actual size used by the panel, which is typically the same as finalSize.
Overrides
Remarks
This method performs the final layout arrangement by:
- Determining line breaks based on available space and element sizes
- Applying uniform sizing constraints from ItemWidth and ItemHeight
- Positioning elements within each line according to the current Orientation
- Implementing StretchItems behavior when enabled
- Handling right-to-left layout adjustments for proper content flow
The arrangement process ensures that elements are optimally distributed within each wrapped line while maintaining visual consistency and respecting the panel's sizing and alignment settings.
InitializeFields()
Initializes member fields to their default values. This method is called prior the CreateChildItems one and allows for initialization of members on which child elements depend.
Declaration
protected override void InitializeFields()
Overrides
MeasureOverride(SizeF)
Measures the size required to accommodate all child elements within the specified constraints, accounting for wrapping behavior and uniform sizing settings.
Declaration
protected override SizeF MeasureOverride(SizeF availableSize)
Parameters
availableSize
Returns
A SizeF representing the minimum size needed to display all child elements with proper wrapping and spacing.
Overrides
Remarks
This method implements the core measurement logic for the wrap layout:
- Measures each child element using available space constraints
- Simulates the wrapping behavior to determine line breaks
- Calculates total space requirements including wrapped lines
- Applies uniform sizing constraints from ItemWidth and ItemHeight
The measurement process respects the current Orientation setting and adjusts calculations accordingly. Elements that exceed the constraint in the primary direction cause line wrapping, while the secondary direction accumulates the total space needed.
ScrollToElement(RadElement)
Scroll to element
Declaration
public void ScrollToElement(RadElement scrollElement)
Parameters
scrollElement
ScrollToLine(int)
scrol to line
Declaration
public void ScrollToLine(int lineNumber)
Parameters
lineNumber
line index to scrool - zero besed