Radzen programatically toggle sidebar menu

How do I toggle the Sidebar menu from code .
When I load a particular page I would like to hide the Menu.
Any sample code or help would be appreciated.


You can check our examples for more info:

HI Enchev
This is not what I was looking for.
I would like to toggle the menu off after opening the application , Clicking on the Menu option to navigate to another page with the menu sidebar not visible ie toggled off.
How do I toggle the "sidebar-toggle0" from the new loaded body(page)

To toggle the Sidebar you have two options: use Toggle() method or Expanded property of the Sidebar (this is what our code is doing). In the page you do not have reference to the Sidebar to use the Toggle() method and the only options is to set somewhere a variable to tell the MainLayout Sidebar if should be expanded or not.


I tried to implement this code but it looks like that it is not compatible any more with the recent version of Radzen. How can the code to toggle the sidebar on mobile devices be added to a blank Radzen project without loosing the code generation features?

Thanks a lot!

Best regards,


Hey @JustJoe,

The code of our demos is still the same and it’s working normally: