New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Using external button to Save Changes in Batch Editing

DESCRIPTION

Save several batch edit grids on click of an external button and also save the other user input.

RadGrid offers a built-in Save Changes button in its command item when in Batch Edit mode. This works great for one single grid.

In some cases, however, you may have several grids on the page and so you would need to save their changes on a click of a button that is outside of the grid.

In addition, the grids may not be the only user input that must be handled by the page.

In such cases, you need to take a few things into account:

SOLUTION

The solution is to check the grids for changes on the client and then implement the common logic in one place, and to ensure it is called once. To do that:

  1. Check for changes on the client for each grid before allowing the postback.
  2. If there are changes, save them through the grid's API.
  3. Extract the common logic from the Click of the button to a separate method that you can call from the grid events.

Below you can find attached a basic example of the approach.

SEE ALSO

In this article
Not finding the help you need? Improve this article