This example illustrates how to track and apply ClientLayout using a separate ListBox.
The main implementation details are:
- Handle the GridViewSettings.CustomJSProperties event and store the currently applied client layout via the MVCxGridView.SaveClientLayout method;
- Handle the client-side ASPxClientGridView Init and EndCallback events, and store the currently applied client layout using a separate ListBox;
- Handle the client-side ASPxClientListBox.SelectedIndexChanged event and perform a custom GridView callback via the client-side MVCxClientGridView.PerformCallback method. Pass the selected client layout as a parameter;
- Handle the custom GridView callback via a separate Action method, retrieve the client layout to be applied, and store this value with ViewData;
- Handle the GridViewSettings.BeforeGetCallbackResult event and check if any client layout should be applied. If so, apply it via MVCxGridView.LoadClientLayout.
WebForms Version:
How to save/load the ASPxGridView's ClientLayout Data and choose them from the ASPxListBox
See Also:
T205817: GridView - How to programmatically Save/Load the last ClientLayout within the Session
The main implementation details are:
- Handle the GridViewSettings.CustomJSProperties event and store the currently applied client layout via the MVCxGridView.SaveClientLayout method;
- Handle the client-side ASPxClientGridView Init and EndCallback events, and store the currently applied client layout using a separate ListBox;
- Handle the client-side ASPxClientListBox.SelectedIndexChanged event and perform a custom GridView callback via the client-side MVCxClientGridView.PerformCallback method. Pass the selected client layout as a parameter;
- Handle the custom GridView callback via a separate Action method, retrieve the client layout to be applied, and store this value with ViewData;
- Handle the GridViewSettings.BeforeGetCallbackResult event and check if any client layout should be applied. If so, apply it via MVCxGridView.LoadClientLayout.
WebForms Version:
How to save/load the ASPxGridView's ClientLayout Data and choose them from the ASPxListBox
See Also:
T205817: GridView - How to programmatically Save/Load the last ClientLayout within the Session