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

Creating dropdown list inside a grid

1 Answer 47 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rudy
Top achievements
Rank 1
Rudy asked on 14 Nov 2014, 09:01 AM
Hi all,

I've tried several times to create a dropdown list inside a grid by following  this link. But I still cannot create a dropdown list inside a grid. It always shows error when I run the program. It says ""An exception of type 'System.ArgumentException' occurred in mscorlib.dll but was not handled in user code. Additional information: Object of type 'POSF.Models.ProductViewModel' cannot be converted to type 'System.String'." I don't know how to do, I have done all like the link said.

Please help me

Here I attach my grid, controller, model, and error message

Best Regards

Rudy

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 18 Nov 2014, 09:24 AM
Hi Rudy,

I reviewed the provided screenshots and noticed that a ProductViewModel object is used as a default value for a few of the fields. I would suggest passing the correct data type, for example: 
model.Field(PODetail=>PODetail.ModelCode).DefaultValue(ViewData["defaultProduct"].ModelCode);

Regards,
Alexander Popov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Rudy
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or