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

Kendo UI Grid<> columns.ForeignKey datasource

1 Answer 134 Views
Templates
This is a migrated thread and some comments may be shown as answers.
Anusha
Top achievements
Rank 1
Anusha asked on 14 Nov 2012, 08:20 PM
Hi, 

I was trying to create data grid, One column is Dropdownlist.  I want  to pass the dynamic  datasource from the Model. where Model is List<object>  . But the ForeignKey cloumn accepts only SelectList as second parameter. But I want  to make this dynamic i.e model.

See Below)

Current Functionality :

  columns.ForeignKey(s => s.FaceId, SelectList)

I need like   columns.ForeignKey(s => s.FaceId, x => x.FacesList)

Please suggest me to achieve this  functionality.

Thanks
Reddy

1 Answer, 1 is accepted

Sort by
0
Bradley Fulton
Top achievements
Rank 1
answered on 09 Feb 2013, 09:51 PM

This has worked for me:
 
columns.ForeignKey(o => o.EmployerId, Model.EmployerDropDown,

    "Id", "Name")

where Model.EmployerDropDown is a List<Employer>, "Id" is the field with the id values, and "Name" is the descriptive field

Tags
Templates
Asked by
Anusha
Top achievements
Rank 1
Answers by
Bradley Fulton
Top achievements
Rank 1
Share this question
or