Foreign key dropdown with multiple columns

3 posts, 1 answers
  1. Tom
    Tom avatar
    2 posts
    Member since:
    May 2016

    Posted 24 May 2016 Link to this post

    I have a grid with a foreign key that is displaying a dropdown in in-line edit mode. That's working fine but I would like to display multiple columns from the parent object in that dropdown not just the key as it currently does. How do I configure for that?

    Here's what I have

              .HtmlAttributes(new {style = "height:600px;"})
              .Columns(columns =>
                  columns.Bound(c => c.DocumentTypeId).Title("Type").Width("120px");
                  columns.ForeignKey(p => p.DocumentCategoryId, (System.Collections.IEnumerable) ViewData["DocumentCategories"], "DocumentCategoryId", "DocumentCategoryId")
                  columns.Bound(c => c.Description);
                  columns.Command(command =>
              .ToolBar(toolbar => { toolbar.Create(); })
              .Editable(editable => editable.Mode(GridEditMode.InLine))
              .Sortable(sortable => { sortable.SortMode(GridSortMode.MultipleColumn); })
              .Scrollable(s => s.Height("auto"))
              .Resizable(resize => resize.Columns(true))
              .DataSource(dataSource => dataSource
                  .Model(model => model.Id(p => p.DocumentTypeId))
                  .Read(read => read.Action("DocumentType_Read", "DocumentType"))
                  .Create(create => create.Action("DocumentType_Create", "DocumentType"))
                  .Update(update => update.Action("DocumentType_Update", "DocumentType"))
                  .Destroy(destroy => destroy.Action("DocumentType_Destroy", "DocumentType"))
              .Events(events => events




  2. Answer
    Eyup avatar
    3962 posts

    Posted 26 May 2016 Link to this post

    Hello Tom,

    I've already replied to your ticket with ID: 1037521. I suggest that we continue our conversation on the mentioned thread.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Tom
    Tom avatar
    2 posts
    Member since:
    May 2016

    Posted 26 May 2016 in reply to Eyup Link to this post

    Yes, thank you.
Back to Top