This example illustrates how to implement cascading combo boxes scenario within the MVC ComboBox Extension.
It is an illustration of the KA18675: MVC ComboBox Extension - How to implement cascaded combo boxes KB Article. Refer to the Article for an explanation.
The "Cascading Combo Boxes" scenario assumes the following steps:
- Perform a callback of the ComboBox to be reloaded via the client-side ASPxClientComboBox.PerformCallback method;
- Pass the required data for filtering (for example, another ComboBox's value) via the Passing Values to a Controller Action through Callbacks technique;
- Handle the Action method (specified via the ComboBoxSettings.CallbackRouteValues.Action property) of the ComboBox to be reloaded, retrieve the related Model data based on the passed filters, and pass this Model to the rendered PartialView.
The example contains the following solutions:
- The solution for v2011 vol 2.10+ builds - MVC3 / Razor View Engine
- The solution for v2010 vol 2 - v2011 vol 2 builds - MVC2 / ASPx View Engine (obsolete)
Question Comments
Added By: SDBala at: 11/14/2013 7:54:04 PM
The example attached seemed to populate the cascading combo's correctly, however in the Create (HTTPPost method) both of the them don't seem to contain the values that i selected. i.e. the when i check the model parameter in the Create method they don't contain any values.
What could be the possible reason
Added By: Jeeva P at: 3/6/2014 2:28:04 AMHow to set Country combobox as checked combobox?
Added By: Mr Price Group Ltd Mr Price Group Ltd at: 3/17/2014 3:18:09 AMAfter struggling to apply this to my project, I think what needs to be stressed here is the fact that, apart from the @model reference, the combobox and only the combobox must be in the partial view so that the framework knows what to update.
I had a <div> tag surrounding the a label element and the combobox and the callback was displaying a popup message with my results. After moving those out of the partial view, the combobox updated correctly.
Added By: Faye Spath at: 6/12/2014 1:23:51 PMHow can I set the selected value of city dropdown upon selecting a country ?
Added By: Sergi (DevExpress Support) at: 6/12/2014 11:42:54 PM Hi Faye,I have created a separate ticket regarding your question: T118096: ComboBox Extension - Cascading Combo Boxes - How to set initial value