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

DropDownLists Shared Datasource binding to subobject of model

1 Answer 46 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Cynthia
Top achievements
Rank 1
Cynthia asked on 28 Oct 2019, 03:41 PM

Hello,

I have a shared datasource that returns a model that has four lists

Model:

public class BillModel : DocumentBaseModel

{

         ...

        public List<HistoryModel> History { get; set; }
        public List<AmendmentModel> Amendments { get; set; }
        public List<OtherDocModel> OtherDocs { get; set; }
        public List<PreviousVersionModel> PreviousVersions { get; set; }

}

Shared Datasource:

             @(Html.Kendo().DataSource<BillModel>()
                       .Name("myDataSource")
                       .Custom(dataSource =>
                       {
                           dataSource
                           .Type("json")
                           .Transport(transport =>
                           {
                               transport.Read(read =>
                               {
                                   read.Action("GetBill", "Bills", new { billNo = "#=Id#" });
                               });
                           });
                       })
                 )

And one of my DDLs:

@(Html.Kendo().DropDownList()
                        .Name("amendments")
                        .DataTextField("Name")
                        .DataValueField("LFID")
                        .DataSource("myDataSource")
                        .HtmlAttributes(new { style = "width: 100%" })
                     .ToClientTemplate()
                 )

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 31 Oct 2019, 02:25 PM

Hello,

The thread seems related with this one(https://www.telerik.com/forums/dropdownlists-shared-datasource-binding-to-subobject-of-model-f6caa4d36110) so lets continue the discussion there.

Regards,
Plamen
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
DropDownList
Asked by
Cynthia
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or