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

[Solved] Autocomplete - Multiple - Cannot use a lambda expression...

0 Answers 54 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Manuel
Top achievements
Rank 1
Manuel asked on 12 Sep 2011, 03:15 PM
Hi!

I am using Telerik MVC Autocomplete with in strongly type (Travel) editor template view with razor syntax.

Editor template is called from Telerik MVC grid (Travel list).

When I use basic Autocomplete paremeters everything works fine but when I add Multiple (or Filterable options) with lambda expressions (see code below) I got "Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type" error in Visual Studio editor and debugger.

Travel editor template autocomplete code:

@(Html.Telerik().AutoComplete()
    .Name("Destination")
    .BindTo(ViewBag.Destinations)
    .AutoFill(true)
    .HighlightFirstMatch(true)
    .Value(ViewBag.DestinationsFromDatabase)
    .Multiple(multi => { multi.Separator(",").Enabled(true); })
)

Name: Destination (string field in Travel entity)
BindTo: ViewBag.Destinations (IEnumerable list of strings - names of all destinations)
Value: ViewBag.DestinationsFromDatabase (string value of existing destinations in Travel entity)

When I remove ".Multiple..." autocomplete works ok but when I add multiple parameter with lambda expression I got "Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type" error.

Please help!
Thanx!




 

 

 

 

 

Tags
ComboBox
Asked by
Manuel
Top achievements
Rank 1
Share this question
or