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. Image for the cookie policy date

Grid: Is there a way to handle the CRUD operations in your own code bypassing it's default functionality?

I have a case, due to the way my POCO objects are stored where your normal method of doing CRUD operations won't work. This is on server side Blazor, so the DataManager is not a good fit. From what I have discovered the ToolbarClick delegate action, fires after the normal handling of the built in commands. So what I'm asking is can that be overridden? 

Thanks in advance,

--Dave

3 Replies

VN Vignesh Natarajan Syncfusion Team June 28, 2019 08:44 AM UTC

Hi Dave,  

Thanks for contacting Syncfusion forums.  

Query: “ From what I have discovered the ToolbarClick delegate action, fires after the normal handling of the built in commands. So what I'm asking is can that be overridden?  

From your query we understand that you need to prevent the default CRUD actions and perform actions on your own. We have given support for OnActionBegin event which will be triggered for each and every action. You can cancel certain actions from it. But Currently we do not have support for this requirement (to prevent default action using actionBegin event). It will be implemented in our 2019 July 1st  nuget release.  

Once implemented you can achieve your requirement as per the below code example 

<EjsGrid id="Grid" ModelType="model" DataSource="gridData" OnActionBegin="@begin" Height="100%" Toolbar="@(new List<string>() { "Add", "Edit" , "Delete" , "Cancel" , "Update" })"> 
            <GridEditSettings AllowEditing="true" AllowAdding="true" AllowDeleting="true"></GridEditSettings> 
……………………………………. 
        </EjsGrid> 
 
   public void begin(SortEventArgs args) 
        { 
 
            if (args.RequestType.ToString() == "BeginEdit" || args.RequestType.ToString() == "Add") // for prevent record from editing & adding 
            { 
                args.Cancel = true; // to prevent the default action 
                // perform your action here 
            } 
        } 

Till then we appreciate your patience.       

Regards, 
Vignesh Natarajan. 



DK Dave Kompel June 28, 2019 07:36 PM UTC

Thank you for your quick response. I think I can wait till Monday :) 

Will that release be in line with the beta release of the rest of the packages beta release yesterday?

If so, will the toolbarClick event be some strongly typed event arg, or will it still be a JObject in an object variable?

Thanks,

--Dave


VN Vignesh Natarajan Syncfusion Team July 1, 2019 11:54 PM UTC

Hi Dave,  

Thanks for the update.  

Query1: “Will that release be in line with the beta release of the rest of the packages beta release yesterday? 

Yes. Nuget releases for Blazor components will be inline with the beta releases of rest of the packages. But unfortunately this time it takes some more time to roll out the nuget release for blazor components. We assure that it will be rolled out on or before July 2nd 2019  
  
Query2: “If so, will the toolbarClick event be some strongly typed event arg, or will it still be a JObject in an object variable? 

Currently the toolbarClick event and other events arguments will not be strongly typed arguments. But we have considered this requirement as improvement and it will be implemented in our next release 2019 Volume 2 Service Pack 1 which is expected to be rolled out in the month end of July 2019.  

Till then we appreciate your patience. 

Regards, 
Vignesh Natarajan. 


Loader.
Live Chat Icon For mobile
Up arrow icon