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

Creating a Dynamic Kendo Menu

0 Answers 172 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Vivek
Top achievements
Rank 1
Vivek asked on 07 May 2013, 05:37 AM
I am trying to read a Model class which should be populated with menu data from the database and then trying to bind that data to the Kendo Menu. I have copied the razor syntax given in the kendo docs (C# Version) and tried to convert it into VB.NET but i am getting an error that no bindto method accepts this many arguments and i can't figure what the error is? i have pasted the code as following, could someone please have a look and point me in the right direction (Menu and MenuItem are model classes)?

@Imports test.Models
@ModelType IEnumerable(Of MenuCategory)

@(Html.Kendo().Menu() _
            .Name("TestMenu") _
            .BindTo(Model,
                    Sub(mappings)
                            mappings.For(Of MenuCategory)(
                                Sub(x)
                                        x.ItemDataBound(
                                            Sub(item, menu)
                                                    item.Text = menu.Name
                                            End Sub) _
                                                    .Children(
                                                        Function(menu)
                                                                Return menu.SubItem
                                                        End Function)
                                        mappings.For(Of MenuItem)(
                                        Sub(x)
                                                x.ItemDataBound(
                                                        Sub(item, menuItem)
                                                                item.Text = menuItem.Name
                                                        End Sub)
                                        End Sub
)
                                                                                      
                                End Sub)
                    End Sub)
            )

No answers yet. Maybe you can help?

Tags
Menu
Asked by
Vivek
Top achievements
Rank 1
Share this question
or