Quantcast
Viewing all articles
Browse latest Browse all 7205

GridView - A simple implementation of cascading comboboxes in Batch Edit mode

The concept of cascading combo boxes requires sending a callback to the server to get data for the second editor based on the first editor's selected value. 
In the meantime, it's impossible to send callbacks for built-in editors and it's necessary to use the EditItemTemplate (see ASPxGridView - Batch Edit - Support a scenario when GridViewComboBoxColumn is used in callback mode).
A basic scenario of this approach requires the following steps:
1) Use the client-side MVCxClientGridView.BatchEditStartEditing  and MVCxClientGridView.BatchEditEndEditing  events  to provide the template combo box with values.
2) Handle the SelectedIndexChanged event to send callbacks if it's required.
3) Handle the client BeginCallback  event to pass parameters on the server.
4) Handle the ASPxClientComboBox.EndCallback event for the second editor to apply the selected item after a callback.
5) Handle the MVCxClientGridView.Init  and MVCxClientGridView.EndCallback events to initialize and reset global variables responsible for data, providing logic after the grid is refreshed. 
6) Use the ideas from GridView - Batch Editing - A simple implementation of an EditItem template  to emulate the behavior of standard grid editors when an end-user uses a keyboard or mouse.

The attached example illustrates how to implement all these steps. 


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>