GridView.CustomScrollAnnotation Event

Allows you to specify custom annotations.

Namespace: DevExpress.XtraGrid.Views.Grid

Assembly: DevExpress.XtraGrid.v21.1.dll


public event EventHandler<GridCustomScrollAnnotationsEventArgs> CustomScrollAnnotation

Event Data

The CustomScrollAnnotation event's data class is DevExpress.XtraGrid.Views.Grid.GridCustomScrollAnnotationsEventArgs.


The CustomScrollAnnotation event allows you to provide data about required custom annotations. Data is represented by the GridScrollAnnotationInfo type that exposes the following properties:

  • RowHandle — handle of the required row (see Row handles in the Rows topic);
  • Color — color of the mark on the scrollbar.

When handling this event, create the data objects and add them to the Annotations collection in the event arguments.

void OnCustomScrollAnnotation(object sender, GridCustomScrollAnnotationsEventArgs e) {
    GridScrollAnnotationInfo info = new GridScrollAnnotationInfo() { RowHandle = 74, Color = Color.Red };

The SetAnnotations method allows you to set annotations for a row array. Note that this method does not add annotations, but resets them.

void OnCustomScrollAnnotation(object sender, GridCustomScrollAnnotationsEventArgs e) {
    int[] rowHandles = new int[] { 5, 17, 74 };
    e.SetAnnotations(Color.Red, rowHandles);
See Also