We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Using existing toolbar edit controls to call controller

Thread ID:





129108 Feb 28,2017 05:07 AM UTC Mar 1,2017 04:23 PM UTC ASP.NET MVC 1
Tags: Grid
Asked On February 28, 2017 05:07 AM UTC

I have a bunch of views for editing, viewing details, delete prompts, etc which were built before we invested in Syncfusion, and initially I'd like to continue to use those from the new index/grid views.

I quite like the default add/edit/delete button and method of selecting a row then clicking the desired button.  Is it possible to trap these clicks and make a call to another page or  would I need to create custom add/edit/delete buttons which I could then trap via the ToolbarClick event?


Prasanna Kumar Viswanathan [Syncfusion]
Replied On March 1, 2017 04:23 PM UTC

Hi Henryk, 
Thanks for contacting Syncfusion support. 

In this you have mentioned that you need to avoid the add, edit and delete operations by default toolbar buttons. To achieve this, we used actionBegin event of ejGrid. In this event we check the condition with the requestType and defining args.cancel as true to avoid the default operations.   

Find the code example :  

  .EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing(); }) 
  .ToolbarSettings(toolbar => 
      toolbar.ShowToolbar().ToolbarItems(items => 
  .Columns(col => 
     .ClientSideEvents(eve => { eve.ActionBegin("actionbegin"); }) 

function actionbegin(args) { 
        if (args.requestType == "add" || args.requestType == "beginedit" || args.requestType == "delete") { 
            args.cancel = true; 

Once we stop the default operation, we need to send the selected data to the views using ajaxPost for editing and deleting. In this event we can get the data in the arguments of actionBegin event. Using these we can able to get the selected data and using ajaxPost we can send the data to the views.  
Using addRecord, deleteRecord and Update Record methods we can able to perform CRUD operations in view pages. 
We can add new record using addRecord method of ejGrid. We have already created a UG documentation for the addrecord method, please refer the below link 
Delete Record  
We can delete a record using deleteRecord method of ejGrid. We have already created a UG documentation for the deleterecord method, please refer the below link 

Update Record 
We can update the record using UpdateRecord method of ejGrid. We have already created a UG documentation for the updaterecord method, please refer the below link 
Prasanna Kumar N.S.V 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon