This demo demonstrates how to have connected (linked) dropdowns where the second dropdown gets binded via Ajax based on the selection of the first dropdown.

The technique requires both server-side C# and client-side jQuery javascript, please refer to the View and Controller tabs for implementation details.
using Microsoft.AspNetCore.Http;
using System.Collections.Generic;
using Trirand.Web.Core;

namespace CoreDemo.Models
    public class DependendDropDownsModel
        public CoreGrid Grid { get; set; }

        public DependendDropDownsModel(HttpContext context)
            Grid = new CoreGrid(context)
                Columns = new List<CoreColumn>()
                                     new CoreColumn { DataField = "ID", Editable = false },
                                     new CoreColumn { DataField = "Name", Editable = true },
                                     new CoreColumn { DataField = "City", Editable = true },
                Width = "675"
@model CoreDemo.Models.DependendDropDownsModel
@using Trirand.Web.Core
@using CoreDemo.Models;

<!DOCTYPE html>
<html lang="en-us">
    <meta charset="utf-8">
    <title>jqGrid for ASP.NET Core - Edit Dialog - Dependent DropDowns</title>    
    <!-- jQuery runtime minified -->
    <script src="~/js/jquery-3.2.1.min.js" type="text/javascript"></script>
    <!-- The jqGrid localization file we need, English in this case -->
    <script type="text/javascript" src="~/js/trirand/i18n/grid.locale-en.js"></script>
    <!-- The jqGrid client-side javascript -->
    <script type="text/javascript" src="/js/trirand/coregrid.min.js"></script>

    <!-- The jQuery UI theme that will be used by the grid. -->
    <link rel="stylesheet" type="text/css" href="" />
    <!-- The jQuery UI theme extension jqGrid needs -->    
    <link rel="stylesheet" type="text/css" href="~/css/trirand/coregrid.css" />
        @Html.Trirand().CoreGrid(Model.Grid, "EditDialogDependentDropDownsGrid")
    <br /><br />
        @await Component.InvokeAsync("CodeTabs", new { product = "grid", example = "editdialogdependentdropdowns" })
    <script type="text/javascript">

           // This function gets called whenever an edit dialog is opened
           function populateCities() {
               // first of all update the city based on the country
               // then hook the change event of the country dropdown so that it updates cities all the time
               $("#Name").bind("change", function(e) { updateCityCallBack($("#Name").val()); });               

           function updateCityCallBack(country) {               
               $("#City").html("<option value=''>Loading cities...</option>").attr("disabled", "disabled");
                   url: '@Url.Action("GetCitiesJson","grid")' + "?country=" + country,
                   type: "GET",
                   success: function(citiesJson) {
                       var cities = eval(citiesJson);
                       var citiesHtml = "";
                       $(cities).each(function(i, option) {
                           citiesHtml += '<option value="' + option + '">' + option + '</option>';

using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Mvc;
using CoreDemo.Models;
using Trirand.Web.Core;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Http;
using CoreDemo.Extensions;

namespace CoreDemo.Controllers.Grid
    public partial class GridController : Controller
        // This is the default action for the View. Use it to setup your jqGrid Model.
        public ActionResult EditDialogDependentDropDowns()
            // Get the model (setup) of the grid defined in the /Models folder.
            var gridModel = new DependendDropDownsModel(HttpContext);
            // This method sets common properties for the grid, different than the default in the Model

            // Pass the custmomized grid model to the View
            return View(gridModel);

        // This method is called when the grid requests data. You can choose any method to call
        // by setting the CoreGrid.DataUrl property. We are doing this in the EditDialog_SetUpGrid method.
        public JsonResult EditDialogDependentDropDowns_DataRequested()
            // Get both the grid and data models. For data model, make sure IQueryable is implemented (most linq-2-* cases)
            // The data model in our case is an autogenerated linq2sql database based on Northwind.
            var gridModel = new DependendDropDownsModel(HttpContext);
            var dataModel = EditDialogDependentDropDowns_GetCountries();

            // This method sets common properties for the grid, different than the default in the Model

            // return the result of the DataBind method, passing the datasource as a parameter
            // jqGrid for ASP.NET Core automatically takes care of paging, sorting, filtering/searching, etc
            return gridModel.Grid.DataBind(dataModel);

        // The data gets passed to the controller as strongly typed objects of your data model, Order in our case
        // This functionality is called Model Binders in ASP.NET MVC terms
        public void EditDialogDependentDropDowns_EditRow(Country editedCountry)
            // Get the grid and database (northwind) models
            var gridModel = new OrdersJqGridModel(HttpContext);
            var northWindModel = new NorthWind();

            // If we are in "Edit" mode, get the Order from database that matches the edited order
            // Check for "Edit" mode this way, we can also be in "Delete" or "Add" mode as well in this method
            if (gridModel.OrdersGrid.AjaxCallBackMode == AjaxCallBackMode.EditRow)
                // Get the data from and find the Order corresponding to the edited row
               IQueryable<Country> gridData = EditDialogDependentDropDowns_GetCountries().AsQueryable<Country>();
               Country countryToUpdate = gridData.Single<Country>(c => c.ID == editedCountry.ID);

               // Update the Order information to match the edited Order data
               // In this demo we do not need to update the database since we are using Session
               // In your case you may need to actually hit the database
               countryToUpdate.Name = editedCountry.Name;
               countryToUpdate.City = editedCountry.City;

               //HttpContext.Session.SetString("countries", JsonConvert.SerializeObject(gridData.ToList<Country>()));
                HttpContext.Session.Set<List<Country>>("countries", gridData.ToList<Country>());

        public void EditDialogDependentDropDowns_SetUpGrid(CoreGrid grid)
            grid.DataUrl = Url.Action("EditDialogDependentDropDowns_DataRequested");
            grid.EditUrl = Url.Action("EditDialogDependentDropDowns_EditRow");
            grid.ToolBarSettings.ShowEditButton = true;
            grid.EditDialogSettings.CloseAfterEditing = true;            
            grid.ClientSideEvents.AfterEditDialogShown = "populateCities";            
            var nameColumn = grid.Columns.Find(c => c.DataField == "Name");
            nameColumn.EditType = EditType.DropDown;
            nameColumn.EditList.Add(new SelectListItem { Text = "USA", Value = "USA", Selected = true});
            nameColumn.EditList.Add(new SelectListItem { Text = "UK", Value = "UK" });
            nameColumn.EditList.Add(new SelectListItem { Text = "Canada", Value = "Canada" });

            var cityColumn = grid.Columns.Find(c => c.DataField == "City");
            cityColumn.EditType = EditType.DropDown;
            cityColumn.EditList.Add(new SelectListItem { Text = "Selected a city", Value = "Select a city" });
        public JsonResult GetCitiesJson(string country)
            List<string> cities = new List<string>();
            if (country == "USA")
                cities.Add("New York");
                cities.Add("Los Angeles");
            if (country == "UK")
            if (country == "Canada")

            return Json(cities);

        // This is a helper method for simulating data
        public IQueryable<Country> EditDialogDependentDropDowns_GetCountries()
            List<Country> countries;
            if (!HttpContext.Session.Exists<List<Country>>("countries"))
                countries = new List<Country>();
                countries.Add(new Country { ID = "1", Name = "USA", City = "New York" });
                countries.Add(new Country { ID = "2", Name = "UK", City = "London" });
                countries.Add(new Country { ID = "3", Name = "Canada", City = "Toronto" });
                countries = HttpContext.Session.Get<List<Country>>("countries");

            return countries.AsQueryable<Country>();

        public class Country
            public string ID { get; set; }
            public string Name { get; set; }
            public string City { get; set; }

Switch theme:

Theming is based on the very popular jQuery ThemeRoller standard. This is the same theming mechanism used by jQuery UI and is now a de-facto standard for jQuery based components. The benefits of using ThemeRoller are huge. We can offer a big set of ready to use themes created by professional designers, including Windows-like themes (Redmond), Apple-like theme (Cupertino), etc. In addition to that any jQuery UI controls on the same page will pick the same theme.

Last, but not least, you can always roll your own ThemeRoller theme, using the superb Theme Editor

To use a theme, simply reference 2 Css files in your Html <head> section - the ThemeRoller theme you wish to use, and the jqGrid own ThemeRoller Css file. For example (Redmond theme):

<link rel="stylesheet" type="text/css" media="screen" href="/themes/redmond/jquery-ui-1.8.2.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/themes/coregrid.css" />