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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ASP.NET Core - Razor Page - DropDownEdit Empty - not displaying list in Grid

Thread ID:





143998 Apr 13,2019 08:03 AM UTC Apr 16,2019 04:12 AM UTC ASP.NET Core - EJ 2 3
Tags: DataGrid
Asked On April 13, 2019 08:03 AM UTC


I have a grid in a razor page (.net core 2.2) containing 2 dropdownedits. The first one render fin, but the second one displays as an empty list.
Can you please help ?

List<string> toolbarCommands = new List<string>() { "ExcelExport", "Search", "Add" };

List<object> gridInlineCommands = new List<object>();
gridInlineCommands.Add(new { type = "Delete", buttonOption = new { iconCss = "e-icons e-delete", cssClass = "e-flat" } });

var providerNameValidationRules = new Dictionary<string, object>() { { "required", true }, { "minlength", 5 } };

var dsStateNames = new List<object>() { new { StateName = "California" }, new { StateName = "Florida" }, new { StateName = "North Carolina" } };
var editParamsStateNamesDdlList = new { @params = new { dataSource = dsStateNames, fields = new { value = "StateName" } } };
var stateNameValidationRules = new Dictionary<string, object>() { { "required", true } };

var dsCredentialsTypes = new List<Object>() { new { CredentialType = "APNP" }, new { CredentialType = "CM" }, new { CredentialType = "DO" } };
var editParamsCredentiaslTypesDdlList = new { @params = new { dataSource = dsCredentialsTypes, fields = new { value = "CredentialType" } } };

<div id="container">
<ejs-grid id="Grid" allowPaging="true" load="onLoad" toolbarClick="toolbarClick" toolbar="toolbarCommands" allowSorting="true" allowFiltering="true" allowExcelExport="true" actionFailure="failure">
<e-data-manager url="Index?handler=DataSource" insertUrl="Index?handler=Insert" updateUrl="Index?handler=Update" removeUrl="Index?handler=Delete" adaptor="UrlAdaptor"></e-data-manager>
        <e-grid-editsettings allowAdding="true" allowDeleting="true" allowEditing="false" showDeleteConfirmDialog="true" mode="Dialog"></e-grid-editsettings>
        <e-grid-filterSettings type="CheckBox"></e-grid-filterSettings>
        <e-grid-pageSettings pageCount="10" pageSize="15"></e-grid-pageSettings>
<e-grid-column field="Id" headerText="Id" isPrimaryKey="true" textAlign="Left" width="20" visible="false"></e-grid-column>
            <e-grid-column field="ProviderName" headerText="Provider Name" width="150"></e-grid-column>
            <e-grid-column field="StateName" headerText="State" textAlign="Left" width="120" editType="dropdownedit" edit="editParamsStateNamesDdlList" validationRules="stateNameValidationRules"></e-grid-column>
            <e-grid-column field="Credentials" headerText="User Credentials" textAlign="Left" width="120" editType="dropdownedit" edit="editParamsCredentiaslTypesDdlList"></e-grid-column>
            <e-grid-column headerText="Manage Records" width="120" commands="gridInlineCommands"></e-grid-column>

Pavithra Subramaniyam [Syncfusion]
Replied On April 15, 2019 12:24 PM UTC

Hi moez, 
Thanks for contacting Syncfusion support. 
From your code example we have found that you are using different data field(“CredentialType”) for DropDownList Component from the column field(“Credentials”) which is the cause of the reported behavior. So we suggest you to use the dataSource that contains the field as same as the column based on which mapping will be done. 
Please get back to us if you need any further assistance on this.  
Pavithra S. 

Replied On April 15, 2019 05:03 PM UTC

Thank you Pavithra !
That solved my problem.

Pavithra Subramaniyam [Syncfusion]
Replied On April 16, 2019 04:12 AM UTC

Hi moez,  

Thanks for your update. 

We are happy to hear that your problem has been solved. 

Please contact us if you need any further assistance. As always, we will be happy to assist you.  

Pavithra S. 


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

Live Chat Icon For mobile
Live Chat Icon