Class ScrollAxisControl
ScrollAxisControl provides support for scrolling through rows and columns. The logic to map from row or column index to scroll position and back is implemented in the ScrollAxisBase which is accessed through the ScrollRows and ScrollColumns property.
You can assign a collection that implements ILineSizeHost and manages row heights or column widths to the RowHeightsProvider and ColumnWidthsProvider. ScrollAxisBase will use information from these objects to map from row or column index to scroll position and back map from row or column index to scroll position and back.
Rows and Columns can have varying size and they can be hidden. They can be frozen at the top, bottom, left and right side. Both pixel scrolling and non-pixel scrolling is supported.
ScrollBar logic and child frame logic is implemented in the base ScrollControl class.
Inheritance
Inherited Members
Namespace: Syncfusion.Windows.Controls.Scroll
Assembly: Syncfusion.GridCommon.WPF.dll
Syntax
public abstract class ScrollAxisControl : ScrollControl, IScrollBarProvider, IScrollInfo, IDisposable
Constructors
ScrollAxisControl()
Initializes a new instance of the ScrollAxisControl class.
Declaration
public ScrollAxisControl()
Properties
AllowPixelScrollPadding
Gets or sets a value indicating whether [allow pixel scroll padding]. Set this to false if you don't want the pixel scroll to take a padding value of 1.
Declaration
public bool AllowPixelScrollPadding { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
ColumnWidthsProvider
Gets or sets the column widths provider.
Declaration
public ILineSizeHost ColumnWidthsProvider { get; set; }
Property Value
Type | Description |
---|---|
ILineSizeHost | The column widths provider. |
HorizontalPixelScroll
Gets or sets a value indicating whether horizontal pixel scroll is enabled.
Declaration
public bool HorizontalPixelScroll { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
LeftColumnIndex
Gets or sets the index of the left column.
Declaration
public int LeftColumnIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The index of the left column. |
RowHeightsProvider
Gets or sets the row heights provider.
Declaration
public ILineSizeHost RowHeightsProvider { get; set; }
Property Value
Type | Description |
---|---|
ILineSizeHost | The row heights provider. |
ScrollColumns
Gets the scroll axis with logic to map from column index to scroll position and back.
Declaration
public ScrollAxisBase ScrollColumns { get; }
Property Value
Type | Description |
---|---|
ScrollAxisBase | The scroll axis for columns. |
ScrollRows
Gets the scroll axis with logic to map from row index to scroll position and back.
Declaration
public ScrollAxisBase ScrollRows { get; }
Property Value
Type | Description |
---|---|
ScrollAxisBase | The scroll axis for rows. |
TopRowIndex
Gets or sets the index of the top row.
Declaration
public int TopRowIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The index of the top row. |
VerticalPixelScroll
Gets or sets a value indicating whether vertical pixel scroll is enabled.
Declaration
public bool VerticalPixelScroll { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Methods
CanAutoCalculateWidth()
Declaration
protected virtual bool CanAutoCalculateWidth()
Returns
Type |
---|
System.Boolean |
CreateScrollAxis(Orientation, Boolean, IScrollBar, ILineSizeHost)
Creates the row or column scroll axis. The default implementation of this method creates either a PixelScrollAxis or LineScrollAxis object. You can override this method if you want to add support for another custom tailored scroll axis object.
Declaration
protected virtual ScrollAxisBase CreateScrollAxis(Orientation orientation, bool pixelScroll, IScrollBar scrollBar, ILineSizeHost lineSizes)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Controls.Orientation | orientation | The orientation (Vertical for row scrolling, Horizontal for column scrolling) |
System.Boolean | pixelScroll | if set to |
IScrollBar | scrollBar | The state of the scroll bar. |
ILineSizeHost | lineSizes | An object that provides row or column sizes. |
Returns
Type | Description |
---|---|
ScrollAxisBase | The scroll axis object. |
Dispose(Boolean)
Declaration
public override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Overrides
GetClipRect(ScrollAxisRegion, ScrollAxisRegion)
Gets the clipping bounds for the specified row and column region.
Declaration
public Rect GetClipRect(ScrollAxisRegion rowRegion, ScrollAxisRegion columnRegion)
Parameters
Type | Name | Description |
---|---|---|
ScrollAxisRegion | rowRegion | The row region. |
ScrollAxisRegion | columnRegion | The column region. |
Returns
Type | Description |
---|---|
System.Windows.Rect | A System.Windows.Rect with clipping bounds. |
IsCellVisible(RowColumnIndex)
Determines whether the specified cell is visible.
Declaration
public bool IsCellVisible(RowColumnIndex cellRowColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
RowColumnIndex | cellRowColumnIndex | Index of the cell row column. |
Returns
Type | Description |
---|---|
System.Boolean |
|
IsColumnVisible(Int32)
Determines whether the column with the specified column index is visible.
Declaration
public bool IsColumnVisible(int columnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | columnIndex | Index of the column. |
Returns
Type | Description |
---|---|
System.Boolean |
|
IsRowVisible(Int32)
Determines whether the row with the specified row index is visible.
Declaration
public bool IsRowVisible(int rowIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | Index of the row. |
Returns
Type | Description |
---|---|
System.Boolean |
|
LineDown()
Scrolls down one row.
Declaration
public override void LineDown()
Overrides
LineLeft()
Scrolls left one left column.
Declaration
public override void LineLeft()
Overrides
LineRight()
Scrolls right one column.
Declaration
public override void LineRight()
Overrides
LineUp()
Scrolls up one row.
Declaration
public override void LineUp()
Overrides
MeasureOverride(Size)
Declaration
protected override Size MeasureOverride(Size constraint)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Size | constraint |
Returns
Type |
---|
System.Windows.Size |
Overrides
OnArrangeOverride(Size, ref Boolean)
Arranges all child frames. Each frames System.Windows.Controls.Canvas.LeftProperty, System.Windows.Controls.Canvas.TopProperty, System.Windows.Controls.Canvas.RightProperty and System.Windows.Controls.Canvas.BottomProperty properties are initialized. System.Windows.UIElement.Arrange(System.Windows.Rect) is called and a the System.Windows.UIElement.Clip property is set. After all child frames were arranged the virtual OnArrangeContent(Size) method is called.
ScrollAxisControl overrides this method to update the scroll axis with controls dimensions given by arrangeSize parameter.
Declaration
protected override Size OnArrangeOverride(Size arrangeSize, ref bool isArrangeDirty)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Size | arrangeSize | The final area within the parent that this element should use to arrange itself and its children. |
System.Boolean | isArrangeDirty | if set to |
Returns
Type | Description |
---|---|
System.Windows.Size | Same size as given in arrangeSize. |
Overrides
OnInvalidated(Boolean)
Called when the InvalidateVisual(Boolean) method was called.
Declaration
protected override void OnInvalidated(bool isArrangeDirty)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isArrangeDirty | if set to |
Overrides
OnMouseWheel(MouseWheelEventArgs)
This is the method that responds to the MouseWheel event.
Declaration
protected override void OnMouseWheel(MouseWheelEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseWheelEventArgs | e | Event Arguments |
Overrides
OnRenderSizeChanged(SizeChangedInfo)
Calls the virtuals OnArrangeContent(Size) method and raises the System.Windows.FrameworkElement.SizeChanged event, using the specified information as part of the eventual event data
ScrollAxisControl overrides this method to update the scroll axis with controls dimensions given by sizeInfo parameter.
Declaration
protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.SizeChangedInfo | sizeInfo | Details of the old and new size involved in the change. |
Overrides
OnScrollLayoutChanged()
Called when settings of ScrollRows or ScrollColumns were changed.
Declaration
protected virtual void OnScrollLayoutChanged()
PageDown()
Scrolls down one page of rows.
Declaration
public override void PageDown()
Overrides
PageLeft()
Scrolls left one page of columns.
Declaration
public override void PageLeft()
Overrides
PageRight()
Scrolls right one page of columns.
Declaration
public override void PageRight()
Overrides
PageUp()
Scrolls up one page of rows.
Declaration
public override void PageUp()
Overrides
PointToCellRowColumnIndex(MouseEventArgs)
Determines the cell under the mouse location.
Declaration
public RowColumnIndex PointToCellRowColumnIndex(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseEventArgs | e | The System.Windows.Input.MouseEventArgs instance containing the event data. |
Returns
Type | Description |
---|---|
RowColumnIndex | The cells row and column index under the mouse location. |
PointToCellRowColumnIndex(Point)
Determines the cell under a given point.
Declaration
public RowColumnIndex PointToCellRowColumnIndex(Point p)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Point | p | The point in client coordinates. |
Returns
Type | Description |
---|---|
RowColumnIndex | The cells row and column index under the point. |
PointToCellRowColumnIndexOutsideCells(Point, Boolean)
Determines the cell under a given point.
Declaration
public RowColumnIndex PointToCellRowColumnIndexOutsideCells(Point p, bool allowOutsideLines)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Point | p | The point in client coordinates. |
System.Boolean | allowOutsideLines | Set this true if point can be below corner of last line. |
Returns
Type | Description |
---|---|
RowColumnIndex | The cells row and column index under the point. |
ScrollToBottom()
Scrolls to bottom.
Declaration
public virtual void ScrollToBottom()
ScrollToLeftEnd()
Scrolls to left end.
Declaration
public virtual void ScrollToLeftEnd()
ScrollToRightEnd()
Scrolls to right end.
Declaration
public virtual void ScrollToRightEnd()
ScrollToTop()
Scrolls to top.
Declaration
public virtual void ScrollToTop()
UpdateAxis(Size)
Updates the row and column axis with this control size and initializes Clip position.
Declaration
public void UpdateAxis(Size arrangeSize)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Size | arrangeSize | Size of the arrange. |