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

DropDownListFor does not work.

1 Answer 65 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 27 May 2014, 07:51 PM
Hey everyone. I am attempting to use a DropDownListFor, however it always results in a crpytic error.

Here is the code:

<div class="TheClass">
@(Html.Kendo().DropDownListFor(a => a.WorkId)
.Name("WorkId")
.DataTextField("WorkName")
.DataValueField("WorkId")
.DataSource(source => {
source.Read(read =>
{
read.Action("GetWork", "Work");
});
})
.HtmlAttributes(new { tabindex = 0 })
)
</div>

During design time, the first line is underlined with a red squiggle mark and it says "(...) "cannot be inferred from the usage".

When I run the code, it blows up with the following error. "CS1593: Delegate 'System.Action' does not take 1 arguments"

What is the problem here?  

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 29 May 2014, 10:45 AM
Hi Dave,

I tried to reproduce this error, but to no avail, and I am not entirely sure what might be causing it. Does it happen only when the WorkId field is used? Do other For helpers fail in the same manner as well? Also, could you please provide a runnable sample project where the issue is reproduced? This would help us pinpoint the exact reason for this behavior and advise you further.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
DropDownList
Asked by
Dave
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or