The DevExpress ASP.NET MVC Grid View allows you to incorporate cascading comboboxes, wherein a value selected within one combobox limits choices in the second combobox. This demo illustrates how to add cascading comboboxes in Batch Edit mode.
- In this demo, the "Country" column editor raises a SelectedIndexChanged event when a user selects a different country. We use the PerformCallback method for the "City" column editor and obtain cities that correspond to the selected country from the server.
- The grid uses a single instance of a column editor for all cells in this column. Before a user starts editing a value in the "City" column, you need to check and update items for the combobox editor. To update items, handle the MVCxGridView's client-side BatchEditStartEditing event and call the "City" combobox's PerformCallback method with the selected country.
On the server side, call the GridViewExtension.GetComboBoxCallbackResult method in the Controller Action ("GetCitiesBatchEdit") to return the result in JSON format for the "City" combobox.
Local Copy of this Demo
To inspect the source code for this demo on your machine, you must first install our components via the DevExpress Component Installer.
You can open a local copy of this online demo directly from this webpage (if using v20.2.8, 21.1.4 or higher).
The source code files for this demo are installed (by default) in the following directory:
Open CS Solution
\Users\Public\Documents\DevExpress Demos XX.X\Components\ASP.NET\CS\MVCxGridViewDemos