We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Populate dropdownlist from server ViewBag

Thread ID:





131868 Aug 1,2017 08:28 AM UTC Aug 3,2017 04:13 AM UTC ASP.NET Core 3
Tags: Grid
Edmund Herbert
Asked On August 2, 2017 11:13 AM UTC

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

Venkatesh Ayothi Raman [Syncfusion]
Replied On 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, 

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-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> 

Note: Dropdown data source should be text and value pair. Please refer to the following Help documentation for more information, 

If we misunderstood your requirement, then could you please provide more details about your requirement and scenario, Grid code example? 

Venkatesh Ayothiraman. 

Edmund Herbert
Replied On August 2, 2017 01:26 PM UTC

Thanks for your help

Venkatesh Ayothi Raman [Syncfusion]
Replied On August 3, 2017 04:13 AM UTC

Hi Edmund, 
Thanks for the update. 

We are very happy to hear that your requirement is achieved. 

Venkatesh Ayothiraman. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon