Creating dropdown list inside a grid

2 posts, 0 answers
  1. Rudy
    Rudy avatar
    5 posts
    Member since:
    Mar 2012

    Posted 14 Nov 2014 Link to this post

    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
  2. Alexander Popov
    Admin
    Alexander Popov avatar
    1444 posts

    Posted 18 Nov 2014 Link to this post

    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.

     
Back to Top