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

No api - CRUD

Thread ID:

Created:

Updated:

Platform:

Replies:

150140 Dec 22,2019 11:19 PM UTC Dec 24,2019 12:06 PM UTC Blazor 3
loading
Tags: Grid
Armando Costa
Asked On December 22, 2019 11:19 PM UTC

I'm using a mixed table data to feed a Grid, so it isn't possible to make changes directly.
How can I use the grid making update/insert/delete on the page razor code
I don't want to use API controller calls.

Renjith Singh Rajendran [Syncfusion]
Replied On December 23, 2019 01:53 PM UTC

Hi Armando, 

Thanks for contacting Syncfusion support. 

Based on your requirement, we suggest you to use the custom way of binding data to Grid, using CustomAdaptor of EjsDataManager. Please refer the documentation link for more details regarding this topic, 
Documentation :  

Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran. 


Armando Costa
Replied On December 23, 2019 02:24 PM UTC

I wanted something simpler like OnUpdate="execute", and no dataset updates deletes or inserts from grid
The code gets very dense for nothing.
Less code, easier to read and correct.

In that case, what happens when I don't override a function ? 



Renjith Singh Rajendran [Syncfusion]
Replied On December 24, 2019 12:06 PM UTC

Hi Armando, 

Based on your requirement, we have prepared a simple sample to perform only update action using CustomAdaptor. Please download the sample from the link below, 
 
The above attached is a simple sample to perform only the update action and we have not added any other codes to perform other operations like sorting, filtering etc. Please refer the below code to perform only update action in Grid using CustomAdaptor, 

 
<EjsGrid TValue="Order" ID="Grid" AllowPaging="true" Toolbar="@(new List<string>() { "Edit", "Update", "Cancel" })"> 
    <EjsDataManager AdaptorInstance="@typeof(CustomAdaptor)" Adaptor="Adaptors.CustomAdaptor"></EjsDataManager> 
    <GridEditSettings AllowEditing="true" Mode="@EditMode.Normal"></GridEditSettings> 
    ... 
</EjsGrid> 
 
@code{ 
    public static List<Order> Orders { get; set; } 
    ... 
 
    // Implementing custom adaptor by extending the DataAdaptor class 
    public class CustomAdaptor : DataAdaptor 
    { 
        // Performs data Read operation to bind Data to Grid at initial loading 
        public override object Read(DataManagerRequest dm, string key = null) 
        { 
            ... 
           return dm.RequiresCounts ? new DataResult() { Result = DataSource, Count = count } : (object)DataSource; 
        } 
        // Performs Update operation 
        public override object Update(DataManager dm, object value, string keyField, string key) 
        { 
            //Handle your custom update operation and return the value 
            return value; 
        } 
    } 
} 


We would like to explain you the behavior of Syncfusion custom binding. We have Read/ReadAsync, Insert/InsertAsync, Remove/RemoveAsync, Update/UpdateAsync, BatchUpdate/BatchUpdateAsync methods to perform the Search, Filter, Sort, Paging, CRUD actions in a custom way(you can add these methods to your application based on your requirement).  
 
Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran. 


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