Articles in this section
Category / Section

How to restrict the expansion of TreeViewAdv items when you dragover?

1 min read

You can restrict the expansion of TreeViewAdv items when you dragover by using the Boolean property IsExpandOnDrop.

Setting IsExpandOnDrop property:

The default value of IsExpandOnDrop property is true.

By default, when you dragover any TreeViewItemAdv in another TreeViewItemAdv, it gets expanded. To restrict this, you can set IsExpandOnDrop property to False in TreeViewAdv.


<syncfusion:TreeViewAdv x:Name="tree" IsExpandOnDrop="False" >
            <syncfusion:TreeViewItemAdv  Header="Marital Status">
                <syncfusion:TreeViewItemAdv Header="Single"/>
                <syncfusion:TreeViewItemAdv Header="Married"/>
                <syncfusion:TreeViewItemAdv Header="Married with Children"/>
            <syncfusion:TreeViewItemAdv Header="Baby Vaccines">
                <syncfusion:TreeViewItemAdv Header="Hepatitis B"/>
                <syncfusion:TreeViewItemAdv Header="Tetanus"/>
                <syncfusion:TreeViewItemAdv Header="Polio"/>
                <syncfusion:TreeViewItemAdv Header="Measles"/>
            <syncfusion:TreeViewItemAdv  Header="Country Information">
                <syncfusion:TreeViewItemAdv Header="Canada"/>
                <syncfusion:TreeViewItemAdv Header="France"/>
                <syncfusion:TreeViewItemAdv Header="Germany"/>
                <syncfusion:TreeViewItemAdv Header="UK"/>
                <syncfusion:TreeViewItemAdv Header="USA"/>



tree.IsExpandOnDrop = false;


Refer to the following screenshot.

Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment