# Menu Opening Behavior

Blazor Edition provides a set of native UI controls built for Blazor such as FlexGrid, Chart, ListView, and input controls including AutoComplete and ComboBox.

## Content



By default, the menu and its submenu items open on a clicking the Menu control. However, you can change this opening behavior of the menu items by setting the [OpenOnClick](/componentone/api/blazor/online-blazor/dotnet-api/C1.Blazor.Menu/C1.Blazor.Menu.C1MenuList.OpenOnClick.html) property to **false**. This changes the opening behavior of the menu items and the items open when you hover on them as shown in the following GIF.

![Blazor Menu opening behavior](https://cdn.mescius.io/document-site-files/images/f5b600ba-f1a7-4f89-a20c-aa6c0c35880d/images/menuopenhover.gif)

To open menu items on hovering over them, use the following code:

```razor
@using C1.Blazor.Menu
<C1Menu OpenOnClick="false" ItemsSource="@_dataSource" OnItemSelected="OnSelectedItem"
        ChildItemsPaths="Subdirectories" DisplayMemberPaths="Name" />
@code{
    string selectedItem = "";
    public void OnSelectedItem(C1MenuItem item)
    {
        selectedItem = GetFullPath(item);
    }
    readonly IList<Hierarchical> _dataSource = new List<Hierarchical>()
{
        new Hierarchical ()
        {
            Name = "Devices",
            Subdirectories = new List<Hierarchical >
    {
                new Hierarchical  {Name = "Wi-fi Router"},
                new Hierarchical
                {
                    Name = "Mobiles",
                    Subdirectories = new List<Hierarchical>
                    {
                        new Hierarchical  {Name = "Xiaomi"},
                        new Hierarchical  {Name = "Apple"},
                        new Hierarchical  {Name = "Nokia"}
                    }
                },
                new Hierarchical  
                {
                    Name = "Appliances",
                    Subdirectories= new List<Hierarchical>
                    {
                        new Hierarchical{Name="Television"},
                        new Hierarchical{Name="Washing Machine"}
                    }
                },
            }
        },
        new Hierarchical
        {
            Name = "Reports",
            Subdirectories = new List<Hierarchical >()
    {
                new Hierarchical
                {
                    Name = "Sales Report",
                    Subdirectories = new List<Hierarchical >()
            {
                        new Hierarchical  {Name = "Quarterly Report"},
                        new Hierarchical  {Name = "Annual Report"}
                    }
                },
                new Hierarchical  {Name = "Profit Report"},
                new Hierarchical  {Name = "Revenue Report"}
            }
        },
    };
    public class Hierarchical
    {
        public string Name { get; set; }
        public List<Hierarchical> Subdirectories { get; set; }
    }
    public static string GetFullPath(C1MenuItem item)
    {
        if (item.ParentItem == null)
            return item.Header;
        return $"{GetFullPath(item.ParentItem)} / {item.Header}";
    }
}
```