This question is locked. New answers and comments are not allowed.
Hi
I am trying to create a data bound menu in VB and not having much luck with the Lamba expression. I am using VS2010 so multiline lambda are ok i beleive. Below if the code and the error assciated. It appears to be almost there bit seem to be mssing soemthing. Any help would be appreciated.
John
Error 17 Overload resolution failed because no accessible 'BindTo' can be called with these arguments:
'Public Function BindTo(dataSource As System.Collections.IEnumerable, factoryAction As System.Action(Of Telerik.Web.Mvc.UI.NavigationBindingFactory(Of Telerik.Web.Mvc.UI.MenuItem))) As Telerik.Web.Mvc.UI.MenuBuilder': Type parameter 'TParent' for 'Public Function For(Of TParent As Class)(action As System.Action(Of Telerik.Web.Mvc.UI.NavigationBindingBuilder(Of TNavigationItem, TParent))) As Telerik.Web.Mvc.UI.NavigationBindingFactory(Of TNavigationItem)' cannot be inferred.
'Public Function BindTo(Of AIMSWeb.NavigationCategory)(dataSource As System.Collections.Generic.IEnumerable(Of AIMSWeb.NavigationCategory), itemDataBound As System.Action(Of Telerik.Web.Mvc.UI.MenuItem, AIMSWeb.NavigationCategory)) As Telerik.Web.Mvc.UI.MenuBuilder': Nested sub does not have a signature that is compatible with delegate 'System.Action(Of Telerik.Web.Mvc.UI.MenuItem, AIMSWeb.NavigationCategory)'.
'Public Function BindTo(viewDataKey As String, siteMapAction As System.Action(Of Telerik.Web.Mvc.UI.MenuItem, Telerik.Web.Mvc.SiteMapNode)) As Telerik.Web.Mvc.UI.MenuBuilder': Nested sub does not have a signature that is compatible with delegate 'System.Action(Of Telerik.Web.Mvc.UI.MenuItem, Telerik.Web.Mvc.SiteMapNode)'. D:\Projects\Advance\AIMSWeb\AIMSWeb\Views\Shared\Navigation.ascx 3 5 AIMSWeb
I am trying to create a data bound menu in VB and not having much luck with the Lamba expression. I am using VS2010 so multiline lambda are ok i beleive. Below if the code and the error assciated. It appears to be almost there bit seem to be mssing soemthing. Any help would be appreciated.
John
| <%= Html.Telerik().Menu() _ |
| .Name("Menu") _ |
| .BindTo(Model, Sub(mappings) |
| mappings.For(Sub(binding) binding _ |
| .itemDataBound(Sub(menuitem,category) |
| menuitem.Text = category.Name |
| End Sub) _ |
| .children(Sub(category) category.NavigationItems()) |
| End Sub) |
| mappings.for(Sub(binding) |
| .itemDataBound(Sub(menuitem, item) |
| menuitem.Text = item.Name |
| End Sub) |
| End Sub) |
| End Sub) |
| %> |
Error 17 Overload resolution failed because no accessible 'BindTo' can be called with these arguments:
'Public Function BindTo(dataSource As System.Collections.IEnumerable, factoryAction As System.Action(Of Telerik.Web.Mvc.UI.NavigationBindingFactory(Of Telerik.Web.Mvc.UI.MenuItem))) As Telerik.Web.Mvc.UI.MenuBuilder': Type parameter 'TParent' for 'Public Function For(Of TParent As Class)(action As System.Action(Of Telerik.Web.Mvc.UI.NavigationBindingBuilder(Of TNavigationItem, TParent))) As Telerik.Web.Mvc.UI.NavigationBindingFactory(Of TNavigationItem)' cannot be inferred.
'Public Function BindTo(Of AIMSWeb.NavigationCategory)(dataSource As System.Collections.Generic.IEnumerable(Of AIMSWeb.NavigationCategory), itemDataBound As System.Action(Of Telerik.Web.Mvc.UI.MenuItem, AIMSWeb.NavigationCategory)) As Telerik.Web.Mvc.UI.MenuBuilder': Nested sub does not have a signature that is compatible with delegate 'System.Action(Of Telerik.Web.Mvc.UI.MenuItem, AIMSWeb.NavigationCategory)'.
'Public Function BindTo(viewDataKey As String, siteMapAction As System.Action(Of Telerik.Web.Mvc.UI.MenuItem, Telerik.Web.Mvc.SiteMapNode)) As Telerik.Web.Mvc.UI.MenuBuilder': Nested sub does not have a signature that is compatible with delegate 'System.Action(Of Telerik.Web.Mvc.UI.MenuItem, Telerik.Web.Mvc.SiteMapNode)'. D:\Projects\Advance\AIMSWeb\AIMSWeb\Views\Shared\Navigation.ascx 3 5 AIMSWeb