Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TreeList.CustomScrollAnnotation Event

Allows you to specify custom annotations.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v24.2.dll

NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.TreeList

#Declaration

[DXCategory("Events")]
public event EventHandler<TreeListCustomScrollAnnotationsEventArgs> CustomScrollAnnotation

#Event Data

The CustomScrollAnnotation event's data class is DevExpress.XtraTreeList.TreeListCustomScrollAnnotationsEventArgs.

#Remarks

The CustomScrollAnnotation event allows you to provide data about custom annotations. Data is represented by the TreeListScrollAnnotationInfo type, which exposes the following properties.

  • Node — the node for which to show a scroll annotation
  • Color — color of the annotation

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

private void treeList1_CustomScrollAnnotation(object sender, DevExpress.XtraTreeList.TreeListCustomScrollAnnotationsEventArgs e) {
    TreeListNode node = treeList1.FindNodeByFieldValue("DEPARTMENT", "Finance");
    e.Annotations = new List<TreeListScrollAnnotationInfo>();
    TreeListScrollAnnotationInfo info = new TreeListScrollAnnotationInfo() {
        Node = node,
        Color = Color.Orange
    };
    e.Annotations.Add(info);
}

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

private void treeList1_CustomScrollAnnotation(object sender, DevExpress.XtraTreeList.TreeListCustomScrollAnnotationsEventArgs e) {
    TreeListNode node = treeList1.FindNodeByFieldValue("DEPARTMENT", "Finance");
    e.SetAnnotations(Color.Red, node);
}
See Also