TreeView for WPF | ComponentOne
C1.WPF.TreeView Namespace / C1TreeView Class / ScrollIntoView Method
The Tree View Item on which we need to place focus
Example

In This Topic
    ScrollIntoView Method
    In This Topic
    Scrolls the content within the ScrollViewer to the specified Tree View Item
    Syntax
    'Declaration
     
    
    Public Sub ScrollIntoView( _
       ByVal item As C1TreeViewItem _
    ) 
    public void ScrollIntoView( 
       C1TreeViewItem item
    )

    Parameters

    item
    The Tree View Item on which we need to place focus
    Example
    This example demonstrates how to use the ScrollIntoView method to scroll to a specific TreeViewItem.
    // Assuming 'treeView' is an instance of C1TreeView
    var itemToScrollTo = FindTreeViewItemById(treeView, itemId);
    if (itemToScrollTo != null)
    {
        treeView.ScrollIntoView(itemToScrollTo);
    }
    See Also