BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Hi Pete,
Thanks for contacting Syncfusion support.
Your requirement of Generic DropDown with Databinding option can be achieved by setting the field of GenericDropDownField related to generic list and then assign the Datasource and bind the fields to GenericDropDownModel. Hence forth you can get the bind values in View page.
<code>
[Controller]
public ActionResult ToolsFeatures()
{
ViewData["DropdownData"] = new Student1DataContext().Student1;
GenericDropDownFields genericdropdownFields = new GenericDropDownFields()
{
Id = "UniversityCode",
Text = "Title"
};
GenericDropDownModel genericdropdownModel = new GenericDropDownModel()
{
DataSource =(System.Collections.IEnumerable)ViewData["DropdownData"], //Bindling Datasource with Generic list
BindTo = genericdropdownFields, //Binding Items with Generic DropDown fields
ClientSideOnClick = "ClientSideOnClick", //Binding ClientSideOnClick event
};
ViewData["myGenericDropDownModel"] = genericdropdownModel; //Binding dynamically created model to Viewdata
return View();
}
}
</code>
We have provided information about Generic DropDown with Data binding concept in our documentation. The documentation is available in following link.
http://help.syncfusion.com/ug/asp.net%20mvc/tools/default.htm#!documents/databinding.htm
We have also prepared a simple sample to explicit this behavior. It can be downloaded from below given link
Warm Regards,
Gurunathan