diff --git a/Cascading-dropdown-remote-data/filter_core/.vs/config/applicationhost.config b/Cascading-dropdown-remote-data/filter_core/.vs/config/applicationhost.config
deleted file mode 100644
index 4f1416f..0000000
--- a/Cascading-dropdown-remote-data/filter_core/.vs/config/applicationhost.config
+++ /dev/null
@@ -1,990 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
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/.dtbcache b/Cascading-dropdown-remote-data/filter_core/.vs/filter_core/DesignTimeBuild/.dtbcache
deleted file mode 100644
index fc1720f..0000000
Binary files a/Cascading-dropdown-remote-data/filter_core/.vs/filter_core/DesignTimeBuild/.dtbcache and /dev/null differ
diff --git a/Cascading-dropdown-remote-data/filter_core/.vs/filter_core/v15/.suo b/Cascading-dropdown-remote-data/filter_core/.vs/filter_core/v15/.suo
deleted file mode 100644
index b29b5aa..0000000
Binary files a/Cascading-dropdown-remote-data/filter_core/.vs/filter_core/v15/.suo and /dev/null differ
diff --git a/Cascading-dropdown-remote-data/filter_core/.vs/filter_core/v15/Server/sqlite3/storage.ide b/Cascading-dropdown-remote-data/filter_core/.vs/filter_core/v15/Server/sqlite3/storage.ide
deleted file mode 100644
index 5e79b82..0000000
Binary files a/Cascading-dropdown-remote-data/filter_core/.vs/filter_core/v15/Server/sqlite3/storage.ide and /dev/null differ
diff --git a/Cascading-dropdown-remote-data/filter_core/.vs/filter_core/v15/Server/sqlite3/storage.ide-shm b/Cascading-dropdown-remote-data/filter_core/.vs/filter_core/v15/Server/sqlite3/storage.ide-shm
deleted file mode 100644
index bbd4eda..0000000
Binary files a/Cascading-dropdown-remote-data/filter_core/.vs/filter_core/v15/Server/sqlite3/storage.ide-shm and /dev/null differ
diff --git a/Cascading-dropdown-remote-data/filter_core/.vs/filter_core/v15/Server/sqlite3/storage.ide-wal b/Cascading-dropdown-remote-data/filter_core/.vs/filter_core/v15/Server/sqlite3/storage.ide-wal
deleted file mode 100644
index ed7e01f..0000000
Binary files a/Cascading-dropdown-remote-data/filter_core/.vs/filter_core/v15/Server/sqlite3/storage.ide-wal and /dev/null differ
diff --git a/Cascading-dropdown-remote-data/filter_core/filter_core/Controllers/HomeController.cs b/Cascading-dropdown-remote-data/filter_core/filter_core/Controllers/HomeController.cs
index db8cd0f..77fb68a 100644
--- a/Cascading-dropdown-remote-data/filter_core/filter_core/Controllers/HomeController.cs
+++ b/Cascading-dropdown-remote-data/filter_core/filter_core/Controllers/HomeController.cs
@@ -6,6 +6,7 @@
using Microsoft.AspNetCore.Mvc;
using filter_core.Models;
using Syncfusion.EJ2.Base;
+ using System.Text.Json;
namespace TestSample.Controllers
{
@@ -21,27 +22,30 @@ public IActionResult Index()
ViewBag.DataSource = Order;
return View();
- }
+ }
-
- public IActionResult StateDataSource([FromBody]ExtendedDataManager dm)
- {
+public IActionResult StateDataSource([FromBody] ExtendedDataManager dm)
+{
+ var states = States.getStates();
- var state = States.getStates();
-
- var Data = state.ToList();
- int count = state.Count();
+ int countryId = 0;
+ if (dm.Where != null && dm.Where.Count > 0)
+ {
+ var jsonValue = (JsonElement)dm.Where[0].value;
- List iterateState= new List();
- foreach (States st in state) {
- if (st.countryId == (Int64)dm.Where[0].value) {
- iterateState.Add(st);
- }
- }
- return dm.RequiresCounts ? Json(new { result = Data.Skip(dm.Skip).Take(dm.Take), count = count }) : Json(iterateState.ToList());
+ if (jsonValue.ValueKind == JsonValueKind.Number)
+ {
+ countryId = jsonValue.GetInt32(); // or GetInt64()
}
+ }
+ var filteredStates = states
+ .Where(st => st.countryId == countryId)
+ .ToList();
+
+ return Json(filteredStates);
+}
public IActionResult CountryDataSource([FromBody]ExtendedDataManager dm)
{
diff --git a/Cascading-dropdown-remote-data/filter_core/filter_core/Startup.cs b/Cascading-dropdown-remote-data/filter_core/filter_core/Startup.cs
index 42042a3..f486a20 100644
--- a/Cascading-dropdown-remote-data/filter_core/filter_core/Startup.cs
+++ b/Cascading-dropdown-remote-data/filter_core/filter_core/Startup.cs
@@ -1,11 +1,8 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Hosting;
namespace filter_core
{
@@ -18,33 +15,35 @@ public Startup(IConfiguration configuration)
public IConfiguration Configuration { get; }
- // This method gets called by the runtime. Use this method to add services to the container.
+ // Register services
public void ConfigureServices(IServiceCollection services)
{
- services.AddMvc();
+ services.AddControllersWithViews();
}
- // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
- public void Configure(IApplicationBuilder app, IHostingEnvironment env)
+ // Configure HTTP request pipeline
+ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
- app.UseBrowserLink();
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Home/Error");
+ app.UseHsts();
}
app.UseStaticFiles();
- app.UseMvc(routes =>
+ app.UseRouting();
+
+ app.UseEndpoints(endpoints =>
{
- routes.MapRoute(
+ endpoints.MapControllerRoute(
name: "default",
- template: "{controller=Home}/{action=Index}/{id?}");
+ pattern: "{controller=Home}/{action=Index}/{id?}");
});
}
}
-}
+}
\ No newline at end of file
diff --git a/Cascading-dropdown-remote-data/filter_core/filter_core/Views/Shared/_Layout.cshtml b/Cascading-dropdown-remote-data/filter_core/filter_core/Views/Shared/_Layout.cshtml
index d37aaaf..d3fe59d 100644
--- a/Cascading-dropdown-remote-data/filter_core/filter_core/Views/Shared/_Layout.cshtml
+++ b/Cascading-dropdown-remote-data/filter_core/filter_core/Views/Shared/_Layout.cshtml
@@ -5,7 +5,7 @@
@ViewData["Title"] - filter_core
@* Syncfusion Essential JS 2 Styles *@
-
+
@* Syncfusion Essential JS 2 Scripts *@
diff --git a/Cascading-dropdown-remote-data/filter_core/filter_core/filter_core.csproj b/Cascading-dropdown-remote-data/filter_core/filter_core/filter_core.csproj
index 8723615..bac9cc0 100644
--- a/Cascading-dropdown-remote-data/filter_core/filter_core/filter_core.csproj
+++ b/Cascading-dropdown-remote-data/filter_core/filter_core/filter_core.csproj
@@ -1,16 +1,11 @@
-
+
- netcoreapp2.0
+ netcoreapp8.0
-
-
+
-
-
-
-
-
+
\ No newline at end of file
diff --git a/README.md b/README.md
index d759146..d9b049c 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,55 @@
-# ASP.MET CORE DataGrid - Cascading Dropdown Remote Data Editing in Data Binding
+# ASP.NET Core DataGrid – Cascading Dropdown Editing with Remote Data
-This sample explains about how to achieve the cascading dropdown with remote data-binding in the ASP.NET Core DataGrid inline editing.
+## Repository Description
+
+This repository demonstrates how to implement cascading dropdown editors with remote data binding inside an ASP.NET Core DataGrid during inline editing scenarios.
+
+## Project Overview
+
+This sample project shows how to configure the Syncfusion ASP.NET Core DataGrid to support cascading DropDownList components when editing grid rows. The primary use case is handling dependent fields such as Country and State, where the available options in one dropdown depend on the selected value of another.
+
+The grid is configured with inline CRUD operations and retrieves its dropdown data from remote endpoints using the `UrlAdaptor`. JavaScript editor lifecycle methods (`create`, `read`, `write`, and `destroy`) are used to fully control the behavior of each dropdown editor.
+
+## Key Features
+
+- Inline editing with Add, Edit, Delete, Update, and Cancel actions
+- Cascading dropdown editors inside grid columns
+- Remote data loading using DataManager and UrlAdaptor
+- Dynamic filtering of dependent dropdown values
+- Clean separation of grid configuration and editor logic
+
+## Technologies Used
+
+- ASP.NET Core MVC
+- Syncfusion EJ2 ASP.NET Core DataGrid
+- JavaScript (EJ2 DropDownList components)
+- Remote data binding using Web API endpoints
## Prerequisites
-* Visual Studio 2022
+- Visual Studio 2022
+- .NET SDK compatible with ASP.NET Core
+- Syncfusion EJ2 ASP.NET Core packages
+
+## Functionality
+
+When a country is selected in the `ShipCountry` column, the `ShipCity` dropdown is enabled and filtered dynamically using a query based on the selected country ID. The state dropdown remains disabled until a valid country selection is made, ensuring proper cascading behavior.
+
+## Running the Application
+
+1. Clone or download the repository to your local machine.
+```
+git clone
+```
+2. Open the solution file in Visual Studio 2022.
+3. Restore NuGet packages by rebuilding the solution.
+4. Run the project and navigate to the home page to view the grid.
+
+## Usage
+Use the toolbar buttons to add or edit a record. Select a country first, then choose the corresponding state from the filtered dropdown list.
-## How to run the project
+## Reference Documentation:
-* Checkout this project to a location in your disk.
-* Open the solution file using the Visual Studio 2022.
-* Restore the NuGet packages by rebuilding the solution.
-* Run the project.
\ No newline at end of file
+- [Getting started with ASP.NET CORE Grid](https://ej2.syncfusion.com/aspnetcore/documentation/grid/getting-started-core)
+- [Editing](https://ej2.syncfusion.com/aspnetcore/documentation/grid/editing/edit)
+- [API Reference](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.grids.grid.html)