windowsforms-devexpress-dot-xtratreelist-dot-treelist-dot-refreshscrollannotations-x28-devexpress-dot-xtraeditors-dot-annotations-dot-scrollannotationkind-x29.md
Updates scrollbar annotations of the specified kind, and causes them to be redrawn.
Namespace : DevExpress.XtraTreeList
Assembly : DevExpress.XtraTreeList.v25.2.dll
NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList
public virtual void RefreshScrollAnnotations(
ScrollAnnotationKind kind = ScrollAnnotationKind.All
)
Public Overridable Sub RefreshScrollAnnotations(
kind As ScrollAnnotationKind = ScrollAnnotationKind.All
)
| Name | Type | Default | Description |
|---|---|---|---|
| kind | DevExpress.XtraEditors.Annotations.ScrollAnnotationKind | All |
The kind of scrollbar annotations to update.
|
The code below updates custom scrollbar annotations for all nodes.
bool ToggleBookmark(TreeListNode node) {
int dataIndex = node != null ? node.Id : -1;
if(dataIndex < 0)
return false;
if(bookmarks.Contains(dataIndex))
bookmarks.Remove(dataIndex);
else
bookmarks.Add(dataIndex);
treeList1.RefreshScrollAnnotations(ScrollAnnotationKind.Custom);
treeList1.InvalidateNode(node);
return true;
}
Private Function ToggleBookmark(ByVal node As TreeListNode) As Boolean
Dim dataIndex As Integer = If(node IsNot Nothing, node.Id, -1)
If dataIndex < 0 Then
Return False
End If
If bookmarks.Contains(dataIndex) Then
bookmarks.Remove(dataIndex)
Else
bookmarks.Add(dataIndex)
End If
treeList1.RefreshScrollAnnotations(ScrollAnnotationKind.Custom)
treeList1.InvalidateNode(node)
Return True
End Function
Note
Run the Hierarchy Column module in the XtraTreeList MainDemo to see the complete example.
See Also