Back to Devexpress

TreeList.RefreshScrollAnnotations(ScrollAnnotationKind) Method

windowsforms-devexpress-dot-xtratreelist-dot-treelist-dot-refreshscrollannotations-x28-devexpress-dot-xtraeditors-dot-annotations-dot-scrollannotationkind-x29.md

latest2.6 KB
Original Source

TreeList.RefreshScrollAnnotations(ScrollAnnotationKind) Method

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

Declaration

csharp
public virtual void RefreshScrollAnnotations(
    ScrollAnnotationKind kind = ScrollAnnotationKind.All
)
vb
Public Overridable Sub RefreshScrollAnnotations(
    kind As ScrollAnnotationKind = ScrollAnnotationKind.All
)

Optional Parameters

NameTypeDefaultDescription
kindDevExpress.XtraEditors.Annotations.ScrollAnnotationKindAll

The kind of scrollbar annotations to update.

|

Remarks

The code below updates custom scrollbar annotations for all nodes.

csharp
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;
}
vb
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

TreeList Class

TreeList Members

DevExpress.XtraTreeList Namespace