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

[Solved] PanelBar Error

0 Answers 22 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.
Salvador
Top achievements
Rank 1
Salvador asked on 29 Jun 2012, 07:16 PM
Hi everyone,

I'm having some problems with the PanelBar and I can't figure this out.

I have this code:

@( Html.Telerik().PanelBar()
        .Name("PanelBar")
        .HtmlAttributes(new { style = "width:auto" })
        .SelectedIndex(0)
            .BindTo((IEnumerable<PortalSPACE2.Models.Menu>)ViewData["menus"], mappings =>
            {
                mappings.For<Opcione>(binding => binding
                    .ItemDataBound((item, menu) =>
                    {
                        item.Text = menu.Texto;
                    })
                    .Children(menu => menu.Submenus));
                mappings.For<Submenu>(binding => binding
                    .ItemDataBound((item, submenu) =>
                    {
                        item.Text = submenu.Texto;
                        item.Url = submenu.URL;
                    }));
            })
            .ExpandMode(PanelBarExpandMode.Single)
                .ClientEvents(ev => { ev.OnSelect("onSelect"); ev.OnLoad("onLoad"); })
    )

When I call this code I get the error: CS1593: Delegate 'System.Action<Telerik.Web.Mvc.UI.PanelBarItem,PortalSPACE2.Models.Menu>' does not take 1 arguments

I have to mention that this code is working in another app, but when I copied the view to my new app it start to acting up.

Intellisense tell me the error starts on the mappings declaration but I can't wrap my head around this.

TIA, any help would be appreciated.
Tags
PanelBar
Asked by
Salvador
Top achievements
Rank 1
Share this question
or