New to Telerik UI for WinFormsStart a free 30-day trial

Collapsing SubPage Items in RadPageView Navigation Mode with Hierarchy

Updated over 1 year ago

Environment

Product VersionProductAuthor
2023.3.1114RadPageView for WinFormsDinko Krastev

Description

When using RadPageView in Navigation Mode with Hierarchy, you may want to collapse all subpage items at Form Load. This tutorial explains how to achieve this in your WinForms application.

Solution

To collapse all subpage items in RadPageView Navigation Mode with Hierarchy, follow these steps:

  1. Add the following code snippet in the Form Load event:
C#

RadPageViewNavigationViewElement navigationElement = this.radPageView1.ViewElement as RadPageViewNavigationViewElement;
foreach (RadPageViewNavigationViewItem item in navigationElement.Items)
{
    item.IsExpanded = false;
}
  1. Run your application.

Now, at Form Load, all the subpage items in the RadPageView Navigation Mode with Hierarchy will be collapsed.

Notes

  • Make sure to replace radPageView1 with the name of your RadPageView control.

See Also