This is a migrated thread and some comments may be shown as answers.

keep radmenu Items on page reload

3 Answers 104 Views
Menu
This is a migrated thread and some comments may be shown as answers.
lina fetisova
Top achievements
Rank 1
lina fetisova asked on 17 Sep 2010, 10:22 AM
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?

3 Answers, 1 is accepted

Sort by
0
lina fetisova
Top achievements
Rank 1
answered on 17 Sep 2010, 12:37 PM
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>
0
Yana
Telerik team
answered on 20 Sep 2010, 12:44 PM
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
0
lina fetisova
Top achievements
Rank 1
answered on 07 Oct 2010, 08:32 AM
Yana, thank you!
Tags
Menu
Asked by
lina fetisova
Top achievements
Rank 1
Answers by
lina fetisova
Top achievements
Rank 1
Yana
Telerik team
Share this question
or