Spread for WPF provides various options for navigating large worksheets, including pixel scrolling, freezing or splitting panes while scrolling, and programmatic scrolling through code.
Below are detailed explanations for each option to help you navigate worksheets efficiently.
Spread for WPF provides comprehensive support for Excel-like precision scrolling, ensuring a smooth and seamless scrolling experience while providing enhanced control over your worksheets. You can scroll horizontally or vertically by a specified number of pixels, allowing accurate movement across worksheet cells. By default, the worksheet scrolls only by rows or columns.
Pixel scrolling can be especially useful in scenarios such as:
Pixel scrolling is enabled for both horizontal and vertical scrolling, allowing precise control in both directions. Here are the ways you can use pixel scrolling:
Scroll modes determine how horizontal and vertical scroll bars work in a worksheet. To specify the scroll mode and change the default behavior of scroll bars, use the HorizontalScrollMode and VerticalScrollMode enumerations. The table below lists various scroll mode options available for both the enumerations.
Values | Description |
Row/Column | Scrolls by rows and columns. This is the default value. |
Pixel | Scrolls pixel by pixel in both directions. |
PixelAndRow/PixelAndColumn | Scrolls by pixels with the mouse, then switches to row and column-based movement once the mouse button is released. |
The GIF below illustrates pixel scrolling in action, demonstrating how it enables more controlled navigation within a worksheet.
Refer to the following example code to enable pixel scrolling in the worksheet.
You can easily scroll to the specific position within the worksheet by using the ScrollToCell method of the GcSpreadSheet class.
The following GIF illustrates how to scroll directly to a specified position in the worksheet through code.
Refer to the following example code to scroll directly to row index 24.
The Freeze Panes feature allows you to keep a specific section of the worksheet visible while scrolling through the rest of the data. This is particularly useful in large worksheets, as it helps you to maintain visibility of header rows or columns, ensuring you can easily identify data points as you navigate through the information. To freeze panes in the worksheet, you can use the FreezePanes property of the IWorksheetView interface.
The following GIF illustrates how the freezing header rows in a sales report worksheet helps you to track the column names while viewing data further down. It provides a clearer view of the data as you scroll through the worksheet.
The sample code below demonstrates the method for freezing panes in a worksheet.
Split panes allow you to divide a worksheet into separate sections or panes, which can be scrolled independently. This feature makes it easier to work with large datasets. To split panes in a worksheet, you can use the Split property of the IWorkSheetView interface.
The following GIF illustrates how the spliting panes in a large sales report worksheet improves navigation and maintains header visibility while scrolling, enabling a more organized view of the data.
Refer to the following example code to set splitting panes in a worksheet.