Identify The Button clicked in batcheditcommand

2 posts, 0 answers
  1. Siva
    Siva avatar
    5 posts
    Member since:
    Oct 2014

    Posted 19 Feb 2016 Link to this post

    I have a RadGrid that is enabled with batch edit. I have two buttons in the command template Add and Save. 

    Add Button will open a modal dialog, with out saving the changes made to rad grid.

    Save Button will save changes using client settings

    Now I need to change the Add Button to save changes before opening the modal dialog.

    I am unable to identify the button that invoked the BatchEditcommand so that i can call the 

    How can I achieve this.


  2. Eyup
    Eyup avatar
    4045 posts

    Posted 24 Feb 2016 Link to this post

    Hi Siva,

    You try using the OnCommand or OnUserAction event handlers to achieve that via the document.ActiveElement reference. Some time ago, there was only the OnCommand event handler, which could be used to cancel grid commands on client-side. This would prevent the command to post back to the server, however, some commands like PageSize, Sorting, etc. also contain client-side logic like hiding the pager item and changing the status of the sort icon in the header cell of a column. Therefore, our developers introduced this additional event handler OnUserAction, which primary goal was to provide a convenient way of canceling these commands, which have client-side logic applied in addition to the server-side event raising. It will be fired for these commands: "Page", "Sort", "PageSize", "Filter".

    I hope the clarification was helpful. The one crucial difference you should note that you have to use get_actionName() instead of get_commandName().

    I hope the clarification was helpful.

Back to Top