Collapse SubPage Item in RadPageView Navigation Mode with Hierarchy

1 Answer 333 Views
PageView
RUNSystem
Top achievements
Rank 1
Iron
Iron
RUNSystem asked on 14 Jan 2022, 03:12 AM

Hi, I'm trying to use the RadPageView with Navigation Mode and Hierarchy feature. Is it possible to set all the SubPages to be collapsed (item collapsed, not NavigationView Collapsed) at the Form Load event ?

This is current condition at Form Load (all sub pages are expanded)

 

And this is what I need at Form Load (all the sub pages are collapsed)

 

Thank you.

1 Answer, 1 is accepted

Sort by
1
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 14 Jan 2022, 12:30 PM

Hi,

The following code snippet demonstrates how to collapse all items in the navigation view:

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

Design time:

Run time:

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

RUNSystem
Top achievements
Rank 1
Iron
Iron
commented on 21 Jan 2022, 08:59 AM

That works perfectly !

Thank's a lot
Tags
PageView
Asked by
RUNSystem
Top achievements
Rank 1
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or