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
public RadScrollLayoutPanel()
public RadScrollLayoutPanel(RadElement viewport, int initialScrollThickness)
Fields
public static readonly RadProperty ForceViewportHeightProperty
public static readonly RadProperty ForceViewportWidthProperty
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
Arranges the RadElement to its final location. The element must call the Arrange method of each of its children.
protected override SizeF ArrangeOverride(SizeF finalSize)
The size that is available for element.
Returns:The rectangle occupied by the element. Usually finalSize. Should you return different size, the Layout system will restart measuring and rearranging the items. That could lead to infinite recursion.
Overrides:
In this method call to the Arrange method of each child must be made.
protected virtual void ArrangeViewPort(RectangleF viewportRect, SizeF finalSize, RadScrollLayoutPanel.ScrollFlags flags)
Called by the element when constructed. Allows inheritors to build the element tree.
protected override void CreateChildElements()
Overrides:
protected Size GetScrollBarsSize(RadScrollLayoutPanel.ScrollFlags flags)
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.
protected override void InitializeFields()
Overrides:
Measures the space required by the RadElement
Used by the layout system.
protected override SizeF MeasureOverride(SizeF availableSize)
The size that is available to the RadElement. The available size can be infinity (to take the full size of the element)
Returns:The minimum size required by the element to be completely visible. Cannot be infinity.
Overrides:
In this method call to the Measure method of each child must be made.
protected virtual void OnNewViewportSet(RadElement oldViewport, RadElement newViewport)
Raises the RadPropertyChanged event and the standard .NET PropertyChanged event to notify subscribers of property value changes.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
The RadPropertyChangedEventArgs containing information about the property change.
Overrides:
protected virtual void OnScrollNeedsChanged(ScrollNeedsEventArgs args)
protected virtual void OnScrollParametersChanged(RadScrollBarElement scrollBar)
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