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

[Solved] PanelBar submenu item expand

7 Answers 136 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Abdulmenan
Top achievements
Rank 1
Abdulmenan asked on 07 Apr 2010, 09:57 PM

I have a panelbar menu item which works with v 2009.3.1223 , when i upgrade to use Telerik extension for ASP.MVC 2010.1.308 some of the submenu items won't expand. when I remove the .Action method it renders fine. I want the action method in place.
item.Add() 
     .Text("Customer") 
     .Items((subItem) => 
        { 
           subItem.Add() 
          .Action("Order", "Customer") 
          .Text("make ordert"); 

Can you help me fix it?
Thanks

7 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 08 Apr 2010, 01:59 PM
Hello Abdulmenan,

One possible reason for the issue could be inaccessible navigation url (generated from action and controller name). Could you verify that the action and controller name are correct ?

Sincerely yours,
Georgi Krustev
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
Abdulmenan
Top achievements
Rank 1
answered on 08 Apr 2010, 02:04 PM
I have checked that, if the controller doesn't exists null object reference fires.
for my case all controller and action methods are in place.
still it is not working
0
Georgi Krustev
Telerik team
answered on 13 Apr 2010, 12:57 PM
Hi Abdulmenan,

Depending on the given information it is hard to determine where could be the problem. Could you please send us a simple test project which reproduces the problem.

Best wishes,
Georgi Krustev
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
Yoel A.F.
Top achievements
Rank 1
answered on 22 Apr 2010, 08:14 PM
Hi, I'm using Telerik_Extensions_for_ASPNET_MVC_2010_1_309 and I have the same problem. If a subitem have an "Action()" method it does not expand, but when I remove the "Action" method it works correctly.
It works fine with Telerik_Extensions_for_ASPNET_MVC_2009_3_1320.
I'm using VS Team System 2008, Framework 3.5, Firefox 3.6.3 (en) and IE 6.0.2900 SP3.
I've tried many things but it does't work.

Could you indicate me how I should fix this problem?
Thanks.

Here is an example code.
Site.Master
<head id="Head1" runat="server">
    <title>Title</title>
    <%
        Html.Telerik().StyleSheetRegistrar()
            .DefaultGroup(group => group.Add("telerik.common.css")
                                        .Add("telerik.Vista.css")
                                        .Compress(true))
            .Render();
    %>
</head>
<body>
...
...
    <%= Html.Telerik().ScriptRegistrar() %>
</body>


Index.aspx
<% Html.Telerik().PanelBar()
       .Name("SysMenu")
       .ExpandAll(true)
       .Items(items =>
       {
           items.Add().Text("Test1")
                      .Items(subItems =>
                        { subItems.Add().Text("Sub Item 1");
                        });
           items.Add().Text("Test4")
                .Items(subItems =>
                {
                    subItems.Add().Text("Sub Item 1").Action("Index", "Test");
                });
           items.Add().Text("Test5")
                .Items(subItems =>
                {
                    subItems.Add().Text("Sub Item 2");
                });
       })
       .ExpandMode(PanelBarExpandMode.Multiple)
       .Render();
%>


TestController.cs
...
...
        public ActionResult Index()
        {
            return View();
        }
...
...

0
Abdulmenan
Top achievements
Rank 1
answered on 22 Apr 2010, 09:03 PM
hi yoel
I have noticed some weird behavior. When inculde some action method which doesn't exist among the group. like

 
subItems.Add().Text("Sub Item 1").Action("Index2", "Test"); 

the menu contains all the list

Abdul

0
Georgi Krustev
Telerik team
answered on 23 Apr 2010, 09:15 AM
Hello Abdulmenan,

This is expected if the generated URL from action and controller name is not accessible. You need to be sure that the action name and the controller name are correct.

Greetings,
Georgi Krustev
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
Yoel A.F.
Top achievements
Rank 1
answered on 23 Apr 2010, 06:21 PM
Hello,
Yes, you are right. In my code the action and controller was not accessible because I was using "[Authorize]" in the controller class. The action and controller name are correct but if I'm not logged in the application then this controller is not accessible.

[Authorize]
public class TestController : BaseController
{
...
...
}

I'm sorry, I was testing the Telerik_Extensions_for_ASPNET_MVC_2010_1_309 and I forgot that in my application I should be logged.
Thank Georgi and Adbulmenan.
Tags
PanelBar
Asked by
Abdulmenan
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Abdulmenan
Top achievements
Rank 1
Yoel A.F.
Top achievements
Rank 1
Share this question
or