- Home
- Forum
- ASP.NET Core
- Populate dropdownlist from server ViewBag
Populate dropdownlist from server ViewBag
Hi Guys,Could you create a grid example that has data-type DropdownList that is populated from (datasource ViewBag) uses a table in EF code firstRegards Edmund Herbert
SIGN IN To post a reply.
3 Replies
VA
Venkatesh Ayothi Raman
Syncfusion Team
August 2, 2017 01:15 PM UTC
Hi Edmund,
Thanks for contacting Syncfusion support.
We have understood from your query, you want to display the Dropdown while editing the grid. Then we suggest you to refer the following Help documentation and online demo for your reference,
Online Demo: http://aspnetcore.syncfusion.com/grid/inlineediting
Help documentation: https://help.syncfusion.com/aspnet-core/grid/editing#cell-edit-type-and-its-edit-options
You may also give a data source from in viewbag for Dropdown list in columns data source property. Please refer to the following code example,
Code example:
|
<ej-grid id="FlatGrid" allow-paging="true" allow-filtering="true" create="onCreated">
<e-filter-settings filter-type="Menu" />
<e-datamanager json="ViewBag.child" />
<e-edit-settings allow-deleting="true" allow-editing="true" allow-adding="true" edit-mode="@(EditMode.Dialog)" />
<e-toolbar-settings show-toolbar="true" toolbar-items="@(new List<string>() {"add","edit","delete","update","cancel" })"></e-toolbar-settings>
<e-columns>
<e-column field="OrderID" is-primary-key="true" header-text="OrderID" width="90"></e-column>
<e-column field="CustomerID" header-text="Customer ID" width="80"></e-column>
<e-column field="EmployeeID" header-text="Employee Id" edit-type="Dropdown" datasource="ViewBag.dropdown"></e-column>
<e-column field="ShipCountry" header-text="Ship Country" width="110"></e-column>
</e-columns>
</ej-grid>
|
Note: Dropdown data source should be text and value pair. Please refer to the following Help documentation for more information,
Help documentation: https://help.syncfusion.com/aspnet-core/dropdownlist/databinding
If we misunderstood your requirement, then could you please provide more details about your requirement and scenario, Grid code example?
Regards,
Venkatesh Ayothiraman.
EH
Edmund Herbert
August 2, 2017 01:26 PM UTC
Thanks for your help
VA
Venkatesh Ayothi Raman
Syncfusion Team
August 3, 2017 04:13 AM UTC
Hi Edmund,
Thanks for the update.
We are very happy to hear that your requirement is achieved.
Regards,
Venkatesh Ayothiraman.
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
EH Edmund Herbert
- Aug 1, 2017 08:28 AM UTC
- Aug 3, 2017 04:13 AM UTC