# Programatically instruct panelmenu to hide or show

**URL:** <https://forum.radzen.com/t/programatically-instruct-panelmenu-to-hide-or-show/10330>\
**Category:** Blazor Server\
**Created:** [March 14, 2022, 12:44pm UTC](https://forum.radzen.com/t/programatically-instruct-panelmenu-to-hide-or-show/10330 "2022-03-14T12:44:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gziakas](https://forum.radzen.com/letter_avatar_proxy/v4/letter/g/ad7895/32.png) [@gziakas](https://forum.radzen.com/u/gziakas)\
**Post date:** [March 14, 2022, 12:44pm UTC](https://forum.radzen.com/t/programatically-instruct-panelmenu-to-hide-or-show/10330/1 "2022-03-14T12:44:41Z")

</div>

Hello, just like the title says, is there a method I can invoke to achieve this when I open a specific page? Do I put the code on the page Load event?

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [March 14, 2022, 2:30pm UTC](https://forum.radzen.com/t/programatically-instruct-panelmenu-to-hide-or-show/10330/2 "2022-03-14T14:30:52Z")

</div>

What does "instruct panelmenu to hide or show" mean? The PanelMenu is always visible in a Radzen application.

---

<div class="post-metadata">

**Author:** ![gziakas](https://forum.radzen.com/letter_avatar_proxy/v4/letter/g/ad7895/32.png) [@gziakas](https://forum.radzen.com/u/gziakas)\
**Post date:** [March 14, 2022, 2:48pm UTC](https://forum.radzen.com/t/programatically-instruct-panelmenu-to-hide-or-show/10330/3 "2022-03-14T14:48:25Z")

</div>

but you can turn it on/off using the sidebar toggle on the upper left corner of the page. I want to be able to hide or show the panelmenu like that programmatically.

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [March 14, 2022, 2:53pm UTC](https://forum.radzen.com/t/programatically-instruct-panelmenu-to-hide-or-show/10330/4 "2022-03-14T14:53:21Z")

</div>

You can check the generated code which Radzen uses to toggle the sidebar.

---

<div class="post-metadata">

**Author:** ![gziakas](https://forum.radzen.com/letter_avatar_proxy/v4/letter/g/ad7895/32.png) [@gziakas](https://forum.radzen.com/u/gziakas)\
**Post date:** [March 14, 2022, 3:06pm UTC](https://forum.radzen.com/t/programatically-instruct-panelmenu-to-hide-or-show/10330/5 "2022-03-14T15:06:42Z")

</div>

could you please point me to the file responsible?

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [March 14, 2022, 3:16pm UTC](https://forum.radzen.com/t/programatically-instruct-panelmenu-to-hide-or-show/10330/6 "2022-03-14T15:16:04Z")

</div>

It is in MainLayout.razor.designer.cs by default:

```auto
        protected async System.Threading.Tasks.Task SidebarToggle0Click(dynamic args)
        {
            await InvokeAsync(() => { sidebar0.Toggle(); });

            await InvokeAsync(() => { body0.Toggle(); });
        }

```
