This is a migrated thread and some comments may be shown as answers.

Command Item Save Changes OnClick event

3 Answers 864 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 03 Feb 2016, 09:45 PM

Hi,

I need to find a way to get the Command Item "Save Changes" Onclick event on the server side. So far i can only capture the event on the ItemCommand event but there is no way of discerning when it comes from the Save changes button.

The long story:

I have a grid that populates with a read only view. I added a template column with a ComboBox. Based on the selection of that ComboBox I will issue an insert command to a separate table.

I was hoping that the built in functionality of the command items would let me override the Save Changes event so I can iterate through all the RadGrid.SelectedItems and do my inserts.

 

I know I can do this using a custom button, but i really hoped there would be some built in functionality for this.

Is there a way of capturing or overriding that event?

 

3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 08 Feb 2016, 03:56 PM
Hi Christian,

If you are using Batch editing, Save command should be initiated only from client-side:
http://www.telerik.com/forums/how-to-fire-the-updateedited-method-from-an-outside-button#5Af7aU0fFEa0UKS5HOhyjA

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Virgil Rodriguez
Top achievements
Rank 1
answered on 23 Oct 2017, 08:44 PM

When you click the "Save changes" button during Batch Edit of a RadGrid, you can catch the event at the ItemCommand event as CommandName="Update".

The "Cancel changes" button can be caught in the same way and has the CommandName="RebindGrid"

This is as of Telerik Version R3 2016.

 

0
Eyup
Telerik team
answered on 26 Oct 2017, 01:36 PM
Hi,

Another approach to achieve this is to use the dedicated built-in BatchEditCommand event handler:
https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/data-editing/edit-mode/batch-editing/server-side-api

Regards,
Eyup
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Christian
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Virgil Rodriguez
Top achievements
Rank 1
Share this question
or