keep radmenu Items on page reload

4 posts, 0 answers
  1. lina fetisova
    lina fetisova avatar
    110 posts
    Member since:
    Apr 2010

    Posted 17 Sep 2010 Link to this post

    Good day!
    I have two menu's: First one and Second one.
    First The SecondOne is empty.
    When I click on FirstMenuItem, I add items to the Second one. If FirstMenuItem has NavigateUrl, a NavigateUrl page opens and there are no Items in the SecondOne menu =( How can I keep them still aftet NavigateUrl redirect?
  2. lina fetisova
    lina fetisova avatar
    110 posts
    Member since:
    Apr 2010

    Posted 17 Sep 2010 Link to this post

    first menu:

    <telerik:RadMenu ID="RadMenu_Administrators" CssClass="radMenuSameZindex" runat="server" EnableRoundedCorners="true" EnableShadows="true" Skin="Windows7" EnableEmbeddedSkins="false" OnItemClick="RadMenu_Administrators_ItemClick" >
                                        <LoadingStatusTemplate>
                                            <asp:Image runat="server" ID="LoadingImage" ImageUrl="~/App_Themes/Theme1/Image/ajax-loader.gif" ToolTip="Идёт загрузка..." Width="16px" Height="16px" style="margin-top:8px" />
                                        </LoadingStatusTemplate>
                                        <Items>
                                            <telerik:RadMenuItem Text="Управление клиентами" Value="users" ImageUrl="App_Themes/Theme1/Image/down.png" >
                                                <GroupSettings ExpandDirection="Down"></GroupSettings>
                                                <Items>
                                                    <telerik:RadMenuItem Text="Клиенты" Value="all_clients" NavigateUrl="~/AllClients.aspx"/>
                                                    <telerik:RadMenuItem Text="Заказы" Value="all_orders" />
                                                    <telerik:RadMenuItem Text="Финансы" Value="finance" />                                                
                                                </Items>
                                            </telerik:RadMenuItem>
                                            <telerik:RadMenuItem Text="Управление проектами" Value="files" ImageUrl="App_Themes/Theme1/Image/down.png">
                                                <GroupSettings ExpandDirection="Down"></GroupSettings>
                                                <Items>
                                                    <telerik:RadMenuItem Text="Сайты" Value="sites" NavigateUrl="~/Administrators/Sites.aspx"/>
                                                    <telerik:RadMenuItem Text="Файлы" Value="docs_files" NavigateUrl="~/Administrators/Files.aspx"/>
                                                    <telerik:RadMenuItem Text="Услуги" Value="finance" />
                                                </Items>
                                            </telerik:RadMenuItem>
                                            <telerik:RadMenuItem Text="Управление статисткой" Value="statistic" ImageUrl="App_Themes/Theme1/Image/down.png">
                                                <GroupSettings ExpandDirection="Down"></GroupSettings>
                                                <Items>
                                                    <telerik:RadMenuItem Text="Отчёт по выгрузкам" Value="unloading_report"/>
                                                    <telerik:RadMenuItem Text="Отчёт все клиенты" Value="all_clients_report"/>
                                                    <telerik:RadMenuItem Text="Отчёт все точки" Value="all_sales_report"/>
                                                </Items>
                                            </telerik:RadMenuItem>
                                            <telerik:RadMenuItem Text="Профиль сотрудника" Value="userinfo" ImageUrl="App_Themes/Theme1/Image/down.png">
                                                <GroupSettings ExpandDirection="Down"></GroupSettings>
                                                <Items>
                                                    <telerik:RadMenuItem Text="Изменить пароль" Value="change_password"/>
                                                </Items>
                                            </telerik:RadMenuItem>
                                        </Items>
                                    </telerik:RadMenu>


    second menu building:

    protected void RadMenu_Administrators_ItemClick(object sender, RadMenuEventArgs e)
            {
                RadMenu sndlevelmenu = ((RadMenu)LoginView_second_level_menu.FindControl("RadMenu_Administrators_second_level_menu"));
                sndlevelmenu.Items.Clear();
                RadMenuItem checked_item = e.Item;
                if (checked_item.Owner.GetType().ToString() == "Telerik.Web.UI.RadMenuItem")
                {
                    checked_item = checked_item.Owner as RadMenuItem;
                }
                //RadMenuItem bigcurrentItem = checked_item.Owner as RadMenuItem;
                switch (checked_item.Text)
                {
                    case "Управление клиентами":
                        sndlevelmenu.Items.Add(new RadMenuItem("Клиенты", "~/AllClients.aspx"));
                        sndlevelmenu.Items.Add(new RadMenuItem("Заказы"));
                        sndlevelmenu.Items.Add(new RadMenuItem("Финансы"));
                        break;
                    case "Управление проектами":
                        sndlevelmenu.Items.Add(new RadMenuItem("Сайты", "~/Administrators/Sites.aspx"));
                        sndlevelmenu.Items.Add(new RadMenuItem("Файлы", "~/Administrators/Files.aspx"));
                        sndlevelmenu.Items.Add(new RadMenuItem("Услуги"));
                        break;
                    case "Управление статисткой":
                        sndlevelmenu.Items.Add(new RadMenuItem("Отчёт по выгрузкам"));
                        sndlevelmenu.Items.Add(new RadMenuItem("Отчёт все клиенты"));
                        sndlevelmenu.Items.Add(new RadMenuItem("Отчёт все точки"));
                        break;
                    case "Профиль сотрудника":
                        sndlevelmenu.Items.Add(new RadMenuItem("Изменить пароль"));
                        break;
                    default:
                        break;
                }

    second menu by itself:

    <telerik:RadMenu ID="RadMenu_Administrators_second_level_menu" CssClass="radMenuSmallZindex" runat="server"  EnableRoundedCorners="true" EnableShadows="true" Skin="capmenu" EnableEmbeddedSkins="false" >
                                                    <LoadingStatusTemplate>
                                                        <asp:Image runat="server" ID="LoadingImage1second_level_menu" ImageUrl="~/App_Themes/Theme1/Image/ajax-loader.gif" ToolTip="Идёт загрузка..." Width="16px" Height="16px" style="margin-top:8px" />
                                                    </LoadingStatusTemplate>                                    
                                                </telerik:RadMenu>
  3. Yana
    Admin
    Yana avatar
    5043 posts

    Posted 20 Sep 2010 Link to this post

    Hi lina,

    Actually ItemClick event is not fired for items that have NavigateUrl set. Please check this help article for more information.

    Regards,
    Yana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  4. lina fetisova
    lina fetisova avatar
    110 posts
    Member since:
    Apr 2010

    Posted 07 Oct 2010 Link to this post

    Yana, thank you!
Back to Top