TreeView with Scrolling?


If I have a treeview that expands all the way down the page to where I need to scroll all the way back up to view whats on the right on my grid. Is there any scrolling connected to this treeview that could make it so i can stay at the top of the page without physically scrolling the browser page all the way down?


1 Reply 1 reply marked as answer

SP Sowmiya Padmanaban Syncfusion Team September 25, 2020 08:13 AM UTC

Hi Chris Johansson,  
 
Greetings from Syncfusion support. 
 
We have checked your requirement with TreeView component. . In TreeView component, we have not provided height property by default. To achieve your requirement, you need to set the height and overflow  as auto for parent div element of TreeView or itself(TreeView element). It will create scrollbar, when TreeView node exceeds the specified height. This solution will help to meet your expected requirement. 
 
Refer the below code snippet. 
 
<div class="tree-area"> 
    <SfTreeView @ref="tree" ID="tree" TValue="Listdata" AllowDragAndDrop="true"> 
        <TreeViewEvents TValue="Listdata" OnNodeDragged="NodeDragged"></TreeViewEvents> 
        <TreeViewFieldsSettings DataSource="@ListDataSource" TValue="Listdata" Id="Id" ParentID="Pid" Text="Name" HasChildren="HasChild" Expanded="Expanded"></TreeViewFieldsSettings> 
    </SfTreeView> 
</div> 
<style> 
    .tree-area { 
        height: 500px; 
        overflow: auto; 
    } 
     
</style> 
 
Refer the sample link below. 
 
 
Please, refer the following links to know more about SF Blazor TreeView component   
 
 
 
 
Please let us know, if you need any further assistance. 
 
Regards,  
Sowmiya.P 


Marked as answer
Loader.
Up arrow icon