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

Dropdownlist receiving undefined

2 Answers 60 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Sharon
Top achievements
Rank 1
Sharon asked on 08 Jun 2020, 02:17 PM

Hello,

i am using mvc returning the Json result as list . In the view using the data source reading action controller name and returning the list 

var result = context.table.sekect(m=>new

{
m.number 

}

return view(result.ToList());

 

.datatextfield(“Number”)

.datavaluefield(“Number”)

 

getting undefined in dropdown.

i have tried the json result as well in another method same results.

 

Do I need to add anything in the startup?

Thank you 

SB

 

 

2 Answers, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 11 Jun 2020, 09:41 AM

Hi Sharon,

Could you please provide a little bit more information about the exact configuration of the DropDownList and the returned response?

Attached you will find a sample project containing a DropDownList. The end point "HomeController -> GetCustomerLocationNameList" returns a list.  Note, that dependencies are deleted due to the size limits and you will need to restore them. Could you please try to modify the project in order to replicate the behavior at your end and send it back to us. This will help us to troubleshoot locally and advise you further. 

Also, I would suggest you take a look at the following Forum thread where similar issue have been discussed.

- https://www.telerik.com/forums/undefined-in-dropdownlist

Looking forward for your reply.

Regards,
Neli
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Neli
Telerik team
answered on 11 Jun 2020, 09:53 AM

Hello Sharon,

In my last reply, I missed the information that you are using UI for ASP.NET Core. Please excuse me about that.

Attached you will find a ASP.NET Core project. The project uses tagHelpers. Please let me know if you are using tagHelper or HtmlHelpers.

Looking forward for your reply.

Regards,
Neli
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
DropDownList
Asked by
Sharon
Top achievements
Rank 1
Answers by
Neli
Telerik team
Share this question
or