RadScrollLayoutPanel
RadScrollLayoutPanel is the layout panel that arranges viewport, horizontal and vertical scrollbars and a spot that appears when both scrollbars are shown.
For more information about scrolling see the help for RadScrollViewer and for IRadScrollViewport.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class RadScrollLayoutPanel : LayoutPanel, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode
Inheritance: objectDisposableObjectRadObjectRadElementLayoutPanelRadScrollLayoutPanel...
Implements:
Inherited Members
Constructors
Creates a panel with no viewport assigned.
public RadScrollLayoutPanel()
Creates a panel with the specified viewport and scrollbar thickness.
public RadScrollLayoutPanel(RadElement viewport, int initialScrollThickness)
The element whose content is arranged and scrolled.
initialScrollThicknessintThe thickness reserved for each visible scrollbar.
Creates a panel that hosts the specified viewport element.
public RadScrollLayoutPanel(RadElement viewport)
The element whose content is arranged and scrolled.
Fields
Identifies the ForceViewportHeight property.
public static readonly RadProperty ForceViewportHeightProperty
Identifies the ForceViewportWidth property.
public static readonly RadProperty ForceViewportWidthProperty
Identifies the ScrollThickness property.
public static readonly RadProperty ScrollThicknessProperty
Properties
Gets the rectangle that is between the two scrollbars when they both are shown.
public FillPrimitive BlankSpot { get; }
Gets a value indicating whether can be performed horizontal scrolling operation
[Browsable(false)]
public bool CanHorizontalScroll { get; }
Gets a value indicating whether can be performed vertical scrolling operation
[Browsable(false)]
public bool CanVerticalScroll { get; }
Gets or sets whether the viewport is forced to take the full available height instead of only the height required by its content; when true, vertical scrolling based on content overflow is effectively disabled.
[Browsable(false)]
public bool ForceViewportHeight { get; set; }
Gets or sets whether the viewport is forced to take the full available width instead of only the width required by its content; when true, horizontal scrolling based on content overflow is effectively disabled.
[Browsable(false)]
public bool ForceViewportWidth { get; set; }
Gets the horizontal scrollbar
public RadScrollBarElement HorizontalScrollBar { get; }
Gets or sets the scroll state of the horizontal scroll bar.
public ScrollState HorizontalScrollState { get; set; }
State of type ScrollState. Default value is AutoHide.
Gets the maximum possible scrolling position.
[Browsable(true)]
public Point MaxValue { get; set; }
Point which contains maximum values for scrolling in horizontal and vertical direction.
Gets or sets whether the viewport should be measured using the panel's available size rather than an unconstrained size; affects whether the viewport's content is allowed to request more space than is visible.
public bool MeasureWithAvaibleSize { get; set; }
Gets the minimum possible scrolling position.
[Browsable(true)]
public Point MinValue { get; set; }
Point which contains minimum values for scrolling in horizontal and vertical direction.
Gets or sets the number of pixels to use when performing Line Up/Down/Left/Right scrolling operation.
Still the scrolling position can be set with one pixel accuracy if the scroll bar thumb is dragged.
[Browsable(true)]
public Point PixelsPerLineScroll { get; set; }
Gets or sets the thickness of the scrollbar.
[Browsable(true)]
public int ScrollThickness { get; set; }
Gets or sets a value indicating whether physical or logical scrolling will be used.
[Browsable(true)]
public bool UsePhysicalScrolling { get; set; }
Boolean value: when it is false logical scrolling will be used.
This property cannot be set to false if Viewport does not implement IRadScrollViewport.
Default value is true for ordinary viewports and false for viewports that implement IRadScrollViewport.
Gets the vertical scrollbar
public RadScrollBarElement VerticalScrollBar { get; }
Gets or sets the scroll state of the vertical scroll bar.
public ScrollState VerticalScrollState { get; set; }
State of type ScrollState. Default value is AutoHide.
Gets or sets the element which content will be scrolled if the scroll viewer has not enough space for it. Very often the viewport is a layout panel that implements IRadScrollViewport.
[Browsable(false)]
public RadElement Viewport { get; set; }
Object of type RadElement which represents the content that could be scrolled if necessary. Default value is null.
Methods
Calculates the viewport extent, determines which scrollbars are needed, and arranges the viewport, scrollbars, and their shared corner.
Arranges the viewport, expanding it to its desired extent on each axis that requires scrolling.
protected virtual void ArrangeViewPort(RectangleF viewportRect, SizeF finalSize, RadScrollLayoutPanel.ScrollFlags flags)
The visible viewport bounds before expansion for scrollable axes.
finalSizeSizeFThe final size allocated to the panel.
flagsRadScrollLayoutPanel.ScrollFlagsThe axes on which scrolling is needed.
Creates the two scrollbar elements and the fill element used for their shared corner.
protected override void CreateChildElements()
Overrides:
Calculates the width and height reserved for the scrollbars from their visibility states and need flags.
protected Size GetScrollBarsSize(RadScrollLayoutPanel.ScrollFlags flags)
The axes on which scrolling is needed.
Returns:A size whose width is reserved for the vertical scrollbar and whose height is reserved for the horizontal scrollbar.
Determines which axes need scrolling by comparing the content extent with the client size and scrollbar thickness. Updates the corresponding need state and raises ScrollNeedsChanged if that state changes.
protected RadScrollLayoutPanel.ScrollFlags GetScrollingNeeds(Size extentSize, Size clientSize)
The full content extent.
clientSizeSizeThe panel's client size.
Returns:RadScrollLayoutPanel.ScrollFlags
The axes on which scrolling is needed.
Initializes the panel's scrollbar states and enables clipping of its contents.
protected override void InitializeFields()
Overrides:
Measures the viewport and scrollbar children. Unless MeasureWithAvaibleSize is enabled, the viewport is measured without a size constraint; this method returns Empty.
Raises ScrollViewportSet after the viewport element is replaced.
protected virtual void OnNewViewportSet(RadElement oldViewport, RadElement newViewport)
The viewport element previously hosted by the panel.
newViewportRadElementThe viewport element now hosted by the panel.
Reapplies viewport auto-size settings when the panel's AutoSizeMode changes and resets layout when ScrollThickness changes.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
The property change being processed.
Overrides:
Raises ScrollNeedsChanged when either scrollbar's need changes.
protected virtual void OnScrollNeedsChanged(ScrollNeedsEventArgs args)
The previous and current need states for both scrollbars.
Raises ScrollParametersChanged for the specified scrollbar.
protected virtual void OnScrollParametersChanged(RadScrollBarElement scrollBar)
The scrollbar whose range or change values were updated.
Invalidates the current measure and arrange results, forcing the panel to recompute the viewport size, extent, and scrollbar visibility/parameters on the next layout pass.
public void ResetLayout()
Scrolls the viewport, using either physical or logical scrolling depending on UsePhysicalScrolling,
by the minimum amount needed to bring the specified child element fully into the visible area. Has no effect if
childElement is null.
public void ScrollElementIntoView(RadElement childElement)
The child element to bring into view.
Scrolls the viewport so that its offset becomes the specified absolute position, clamped to the valid range between MinValue and the last position that still keeps the large-change extent visible.
Scrolls the viewport by the specified relative offset from its current position; the resulting position is clamped to the valid scroll range.
Events
Occurs when horizontal or vertical scrolling is performed
public event RadScrollPanelHandler Scroll
Occurs when the need for horizontal or vertical scrollbar has changed.
public event ScrollNeedsHandler ScrollNeedsChanged
Occurs when property that affects the scrolling functionality is changed.
public event RadPanelScrollParametersHandler ScrollParametersChanged
Occurs when the Viewport is changed
[Browsable(false)]
public event ScrollViewportSetHandler ScrollViewportSet