Auto Collapse PanelMenu

Hi

Is there any way to get the PanelMenu to auto collapse

so if I click expand on "Inputs" then "General" will collapse so you don't have multiple MenuItemes open add once

Just like it works on a Accordion with multiple expand and single expand
so that I can have single expand on a PanelMenu :slight_smile:

Check the second example in our demo for reference:

1 Like

I cant seam to figure out how to implment that into a Panelmenu build like this:

        <RadzenPanelMenu >
            <RadzenPanelMenuItem Text="Home" Path="/" Icon="home"></RadzenPanelMenuItem>
            
            <RadzenPanelMenuItem Text="Production Floor" Icon="donut_large">
                <RadzenPanelMenuItem Text="My Station" Path="mystation"></RadzenPanelMenuItem>
            </RadzenPanelMenuItem>
            
            <RadzenPanelMenuItem Text="Information" Icon="info">
                <RadzenPanelMenuItem Text="All Stations" Path="allstations"></RadzenPanelMenuItem>
                <RadzenPanelMenuItem Text="Floor View" Path="floorview"></RadzenPanelMenuItem>
                <RadzenPanelMenuItem Text="Unit Information" Path="unitinformation"></RadzenPanelMenuItem>
            </RadzenPanelMenuItem>
            
            <RadzenPanelMenuItem Text="Equipment" Icon="construction">
                <RadzenPanelMenuItem Text="RoboCeption" Path="roboception"></RadzenPanelMenuItem>
                <RadzenPanelMenuItem Text="TorqueTool" Path="torquetool"></RadzenPanelMenuItem>
                <RadzenPanelMenuItem Text="Pick2Light" Path="pick2light"></RadzenPanelMenuItem>
                <RadzenPanelMenuItem Text="LabelPrint" Path="labelprint"></RadzenPanelMenuItem>
            </RadzenPanelMenuItem>

            <RadzenPanelMenuItem Text="Support" Icon="build">
                <RadzenPanelMenuItem Text="JobQueue" Path="jobqueue"></RadzenPanelMenuItem>
                <RadzenPanelMenuItem Text="Graph Management" Path="graphmanagement"></RadzenPanelMenuItem>
                <RadzenPanelMenuItem Text="Sfc Management" Path="sfcmanagement"></RadzenPanelMenuItem>
            </RadzenPanelMenuItem>
            
            <AuthorizeView Roles="test">
                <RadzenPanelMenuItem Text="Configurations" Icon="tune">
                    <RadzenPanelMenuItem Text="Capability" Path="capability"></RadzenPanelMenuItem>
                </RadzenPanelMenuItem>
            </AuthorizeView>

            <RadzenPanelMenuItem Text="Help" Icon="help">
                <RadzenPanelMenuItem Text="Help" Path="help"></RadzenPanelMenuItem>
                <RadzenPanelMenuItem Text="Documentation" Path="documentation"></RadzenPanelMenuItem>
                <RadzenPanelMenuItem Text="Profile" Path="profile"></RadzenPanelMenuItem>
                <RadzenPanelMenuItem Text="User Management" Path="usermanagement"></RadzenPanelMenuItem>
            </RadzenPanelMenuItem>

            <RadzenPanelMenuItem Text="3D Demo" Icon="view_in_ar">
                <RadzenPanelMenuItem Text="example 01" Path="example01"></RadzenPanelMenuItem>
                <RadzenPanelMenuItem Text="example 02" Path="example02"></RadzenPanelMenuItem>
                <RadzenPanelMenuItem Text="example 03" Path="example03"></RadzenPanelMenuItem>
            </RadzenPanelMenuItem>
        </RadzenPanelMenu>```

I Can see how to implement it when you are doing it with a dynamiclly generated list in the exsampel

        bool _expanded;
        public bool Expanded 
        {
            get
            {
                return _expanded;    
            }
            set
            {
                if (_expanded != value)
                {
                    collection()?.Where(i => i != this).ToList().ForEach(s => s.Expanded = false);

                    _expanded = value;
                    OnPropertyChanged(nameof(Expanded));
                }
            }
        }

But cant see how you can use that on a Menu that is allready predefinded????

This thread might useful as well:

@enchev

Yeah but this means I have to create to Lists, one for categories and one for pages??

just so it can be generated by code so I can use the Auto Collapse feature.

so i cant use a a PanelMenu that is set up like this: With the Auto Collapse feature

        <RadzenPanelMenu>
            <RadzenPanelMenuItem Text="Home" Path="/" Icon="home"></RadzenPanelMenuItem>

            <RadzenPanelMenuItem Text="Production Floor" Icon="donut_large">
                <RadzenPanelMenuItem Text="My Station" Path="mystation"></RadzenPanelMenuItem>
            </RadzenPanelMenuItem>

            <RadzenPanelMenuItem Text="Information" Icon="info">
                <RadzenPanelMenuItem Text="All Stations" Path="allstations"></RadzenPanelMenuItem>
                <RadzenPanelMenuItem Text="Floor View" Path="floorview"></RadzenPanelMenuItem>
                <RadzenPanelMenuItem Text="Unit Information" Path="unitinformation"></RadzenPanelMenuItem>
            </RadzenPanelMenuItem>

            <RadzenPanelMenuItem Text="Equipment" Icon="construction">
                <RadzenPanelMenuItem Text="RoboCeption" Path="roboception"></RadzenPanelMenuItem>
                <RadzenPanelMenuItem Text="TorqueTool" Path="torquetool"></RadzenPanelMenuItem>
                <RadzenPanelMenuItem Text="Pick2Light" Path="pick2light"></RadzenPanelMenuItem>
                <RadzenPanelMenuItem Text="LabelPrint" Path="labelprint"></RadzenPanelMenuItem>
            </RadzenPanelMenuItem>

            <RadzenPanelMenuItem Text="Support" Icon="build">
                <RadzenPanelMenuItem Text="JobQueue" Path="jobqueue"></RadzenPanelMenuItem>
                <RadzenPanelMenuItem Text="Graph Management" Path="graphmanagement"></RadzenPanelMenuItem>
                <RadzenPanelMenuItem Text="Sfc Management" Path="sfcmanagement"></RadzenPanelMenuItem>
            </RadzenPanelMenuItem>

            <AuthorizeView Roles="test">
                <RadzenPanelMenuItem Text="Configurations" Icon="tune">
                    <RadzenPanelMenuItem Text="Capability" Path="capability"></RadzenPanelMenuItem>
                </RadzenPanelMenuItem>
            </AuthorizeView>

            <RadzenPanelMenuItem Text="Help" Icon="help">
                <RadzenPanelMenuItem Text="Help" Path="help"></RadzenPanelMenuItem>
                <RadzenPanelMenuItem Text="Documentation" Path="documentation"></RadzenPanelMenuItem>
                <RadzenPanelMenuItem Text="Profile" Path="profile"></RadzenPanelMenuItem>
                <RadzenPanelMenuItem Text="User Management" Path="usermanagement"></RadzenPanelMenuItem>
            </RadzenPanelMenuItem>

            <RadzenPanelMenuItem Text="3D Demo" Icon="view_in_ar">
                <RadzenPanelMenuItem Text="example 01" Path="example01"></RadzenPanelMenuItem>
                <RadzenPanelMenuItem Text="example 02" Path="example02"></RadzenPanelMenuItem>
                <RadzenPanelMenuItem Text="example 03" Path="example03"></RadzenPanelMenuItem>
            </RadzenPanelMenuItem>
        </RadzenPanelMenu>