Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]Welcome to DevExpress .NET Documentation
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
   Reporting
  [Collapse]Data Grid
   [Expand]Getting Started
   [Expand]Implementation Details
   [Expand]Views
   [Expand]Grid View Data Layout
   [Expand]Binding to Data
   [Expand]Master-Detail Data Representation
   [Expand]Data Editing and Validation
   [Expand]Grouping
   [Expand]Selection
   [Expand]Filtering and Searching
   [Expand]Sorting
   [Expand]Data Summaries
   [Collapse]Data Scrolling
     Data Scrolling Overview
     Table and TreeList View Scrolling in Code
     Card View Scrolling in Code
     Per-Pixel Scrolling
     Cascading Data Updates
     Fixed Group Rows
     Column Headers Horizontal Scrolling
     Touch Scrollbars
     Scrollbar Annotations
     Fixed Rows
   [Expand]Focus and Navigation
   [Expand]Conditional Formatting
   [Expand]Drag-and-Drop
   [Expand]Appearance Customization
   [Expand]MVVM Enhancements
   [Expand]Printing and Exporting
   [Expand]End-User Interaction
   [Expand]Miscellaneous
   [Expand]Performance Improvement
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]End-User Capabilities
   [Expand]Examples
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Diagram Control
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Scrollbar Annotations

The GridControl's TableView and TreeListView can display specific colored marks within the vertical scrollbar: scrollbar annotations. These marks correspond to specific grid rows (or treelist nodes).

Expanded Built-in annotations types

The GridControl views can display the scrollbar annotations marks for the following items.

  • invalid rows and cells
  • selected rows
  • focused rows
  • search results
Tip

The GridControl supports the display of annotation marks for rows that meet custom criteria. See the Adding custom annotations section.

Limitations

When the GridControl is bound to data in the Server Mode, the control supports scrollbar annotations for the focused and selected rows only.

Expanded Adding scrollbar annotations

To enable scrollbar annotations, use the TableView.ScrollBarAnnotationMode (or TreeListView.ScrollBarAnnotationMode) property. You can set this property to the following flags.

  • InvalidRows - marks invalid rows
  • InvalidCells - marks invalid cells
  • Selected - marks selected rows
  • FocusedRow - marks a focused row
  • SearchResult - marks search results
  • Custom - marks rows that fit custom criteria
  • All - displays all the marks described above
  • None - scrollbar annotations are disabled

The code sample below demonstrates how to enable scrollbar annotations for selected and focused rows.

Expanded Adding custom annotations

In addition to built-in annotations, you can enable custom scrollbar annotations for:

  • a predefined collection of rows;
  • rows that fit custom criteria.
Displaying annotations for a predefined set of rows.

You can define a set of rows and their annotations in the following way.

  1. Create a collection of ScrollBarAnnotationRowInfo objects, each of these objects should store the following information:
  2. Handle the view's TableView.ScrollBarAnnotationsCreating (or TreeListView.ScrollBarAnnotationsCreating event).
  3. Pass a collection of rows with corresponding annotations to the event argument's ScrollBarAnnotationsCreatingEventArgs.CustomScrollBarAnnotations property.
Displaying annotations for rows that fit custom criteria.

To display annotation marks dynamically based on row values follow the steps below.

  1. Handle the view's TableView.ScrollBarCustomRowAnnotation (or TreeListView.ScrollBarCustomRowAnnotation event
  2. Get the currently processed row using the event argument's ScrollBarCustomRowAnnotationEventArgs.Row property.
  3. If the row values meet the required criteria, define appearance of the row's corresponding annotation mark. To do this, pass an instance of the ScrollBarAnnotationInfo class with the appearance settings to the event argument's ScrollBarCustomRowAnnotationEventArgs.ScrollBarAnnotationInfo property.

The code sample below demonstrates how to display marks for rows, whose Visits field value is 0.

The image below illustrates the result.

Note

To automatically update custom scrollbar annotations, it is required to set the GridControl.AllowLiveDataShaping property to true.

Expanded Customizing scrollbar annotations

To customize the appearance of built-in scrollbar annotations, use the TableView.ScrollBarAnnotationsAppearance (or the TreeListView.ScrollBarAnnotationsAppearance) property. This property provides access to the ScrollBarAnnotationsAppearance object that stores appearance settings of all the built-in annotations.

The ScrollBarAnnotationsAppearance object properties correspond to built-in annotation marks. The following appearance settings are available.

Property

Description

ScrollBarAnnotationsAppearance.FocusedRow Gets or sets appearance settings for scrollbar annotation marks that correspond to focused row. This is a dependency property.
ScrollBarAnnotationsAppearance.InvalidCells Gets or sets appearance settings for scrollbar annotation marks that correspond to invalid cells. This is a dependency property.
ScrollBarAnnotationsAppearance.InvalidRows Gets or sets appearance settings for scrollbar annotation marks that correspond to invalid rows. This is a dependency property.
ScrollBarAnnotationsAppearance.SearchResult Gets or sets appearance settings for scrollbar annotation marks that correspond to search results. This is a dependency property.
ScrollBarAnnotationsAppearance.Selected Gets or sets the appearance settings for scrollbar annotation marks that correspond to selected rows. This is a dependency property.

The code sample below demonstrates how to customize a scrollbar annotation mark that corresponds to a focused row.

Is this topic helpful?​​​​​​​