Kendo UI Grid<> columns.ForeignKey datasource

2 posts, 0 answers
  1. Anusha
    Anusha avatar
    1 posts
    Member since:
    Nov 2012

    Posted 14 Nov 2012 Link to this post


    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.

  2. Bradley Fulton
    Bradley Fulton avatar
    6 posts
    Member since:
    Jan 2010

    Posted 09 Feb 2013 Link to this post

    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

Back to Top