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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:

Created:

Updated:

Platform:

Replies:

145554 Jun 27,2019 07:00 PM UTC Jul 1,2019 11:54 PM UTC Blazor 3
loading
Tags: Grid
Dave Kompel
Asked On June 27, 2019 07:00 PM UTC

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

Vignesh Natarajan [Syncfusion]
Replied On 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. 


Dave Kompel
Replied On 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

Vignesh Natarajan [Syncfusion]
Replied On 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. 


CONFIRMATION

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

Live Chat Icon For mobile
Live Chat Icon