TreeList.CustomScrollAnnotation Event
Allows you to specify custom annotations.
Namespace: DevExpress.XtraTreeList
Assembly: DevExpress.XtraTreeList.v24.2.dll
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