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

Data Binding Question

1 Answer 60 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Marcab
Top achievements
Rank 1
Veteran
Marcab asked on 20 Dec 2019, 07:22 PM

I'm currently trying to bind a DropDownList in a custom editor template. I want to populate this DropDownList with a list of organizations from the organization table.

The custom editor template is bound to the Volunteer model. A volunteer may belong to an organization, but this is not required, and there is no relationship between the Volunteer and Organization tables.

When adding a new volunteer, I want to display a list of organizations. The name of the selected organization will be saved in the Organization field of the Volunteer table.

In the case of an edit, I want to display a list of organizations in the DropDownList, with the volunteer's organization selected (in the case where the volunteer belongs to an organization).

I've searched through a number of examples, but haven't been able to find something that would work for this scenario. Any advice on how to proceed would be very much appreciated.

1 Answer, 1 is accepted

Sort by
0
Marcab
Top achievements
Rank 1
Veteran
answered on 23 Dec 2019, 07:50 PM
Please disregard. There was an issue with my view model, which I have now resolved.
Tags
DropDownList
Asked by
Marcab
Top achievements
Rank 1
Veteran
Answers by
Marcab
Top achievements
Rank 1
Veteran
Share this question
or