This example illustrates how to pass data through a custom MVC TreeList callback.
- Perform a custom TreeList callback via the client-side MVCxClientTreeList.PerformCallback method;
- Pass the required data as a parameter;
- Handle the TreeListSettings.CustomActionRouteValues.Action method and retrieve the passed parameter. In general, it is possible to use the Action method specified for all TreeList callbacks (TreeListSettings.CallbackRouteValues.Action). The illustrated technique allows handling a custom TreeList callback within a separate Action method, whose signature can be different. Usually, custom callbacks are used for changing the TreeList's state programmatically in a custom manner;
- Pass the retrieved value to the TreeList's PartialView via the ViewData key.
See Also:
How to get all GridView selected keys and pass them to a Controller
- Perform a custom TreeList callback via the client-side MVCxClientTreeList.PerformCallback method;
- Pass the required data as a parameter;
- Handle the TreeListSettings.CustomActionRouteValues.Action method and retrieve the passed parameter. In general, it is possible to use the Action method specified for all TreeList callbacks (TreeListSettings.CallbackRouteValues.Action). The illustrated technique allows handling a custom TreeList callback within a separate Action method, whose signature can be different. Usually, custom callbacks are used for changing the TreeList's state programmatically in a custom manner;
- Pass the retrieved value to the TreeList's PartialView via the ViewData key.
See Also:
How to get all GridView selected keys and pass them to a Controller