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

EjsGrid edit mode | update data source

Hi, I am using the Blazor EjsDataGrid in edit mode bound to some simple objects.

1. It displays fine, but after editing, the original objects are not updated. This could be by design, but if so can you advise how to update the original objects after edits.
2. If you edit more than one row, then sort a column, one row remains updated (in the UI only, not the bound object), while the other row displays the original values, not the updated ones.  This could be related to 1. but it is weird that one row behaves differently to another.

Thanks

15 Replies

UN Unknown Syncfusion Team May 22, 2019 01:19 PM UTC

I have the same problem...


TS Thavasianand Sankaranarayanan Syncfusion Team May 24, 2019 01:55 PM UTC

Hi John, 
  
Greetings from Syncfusion support. 
  
Query 1: After editing original objects are not updated. 
                                        & 
Query 2: If you edit more than one row, then sort a column, one row remains updated (in the UI only, not the bound object), while the other row displays the original values, not the updated ones 
  
We have checked your queries and we are able to reproduce the reported issue from our end. Currently we don’t have support for CRUD operations in Grid. We are currently working on this feature, it will be rolled out on our upcoming patch release and we will update the sample on May 31st, 2019.  
  
Until then we appreciate your patience. 
  
Regards, 
Thavasianand S.  



JO John May 24, 2019 02:33 PM UTC

Great, thank you.  Look forward to it.


TS Thavasianand Sankaranarayanan Syncfusion Team May 27, 2019 09:07 AM UTC

Hi John, 

Thanks for your update. 

As we promised we will update you the sample. 

Regards, 
Thavasianand S. 



VS Vijayanand S Syncfusion Team May 31, 2019 11:32 AM UTC

Hi John, 
 
Sorry for the inconvenience caused. 
  
Due to the delay of our weekly patch release for Blazor, the feature (Implementation of CRUD operations in Grid) is expected to be rolled out on June 6th, 2019. So we will update the sample for your requirement on June 7th, 2019.  
 
Until then we appreciate your patience.  

Regards,
Vjay 



GS Gurupriyadharshini Sankaranarayanan Syncfusion Team June 11, 2019 05:10 PM UTC

Hi John 
   
Thanks for your patience. 
  
We have checked your query and the reported issue is resolved in our updated nuget package(17.1.0.51-beta) version. We have prepared a sample where you can update the edited data after editing the record. Please refer the below code snippet and sample link. 
  
[Index.razor] 
<EjsGrid id="Grid" DataSource="@gridData" AllowPaging="true" AllowSorting="true" Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })"> 
    <GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true"></GridEditSettings> 
    <GridColumns> 
        <GridColumn Field=@nameof(OrdersDetails.OrderID) HeaderText="Order ID" IsprimaryKey="true" TextAlign="@TextAlign.Right" Width="120"></GridColumn> 
        .  .  .  .  . 
    </GridColumns> 
</EjsGrid> 
 
@functions{ 
    public List<OrdersDetails> gridData { get; set; } 
    protected override void OnInit() 
    { 
        gridData = OrdersDetails.GetAllRecords(); 
    }    
} 
  
Please refer the below cdn links in your script file. 
 
[_Host.cshtml] 
<environment include="Development"> 
        <link rel='nofollow' href="https://cdn.syncfusion.com/ej2/material.css" rel="stylesheet" /> 
        <script src="https://cdn.syncfusion.com/ej2/dist/ej2.min.js"></script> 
        <script src="https://cdn.syncfusion.com/ej2/dist/ejs.interop.min.js"></script> 
    </environment> 
 
  
Please get back to us for further assistance.  
  
Regards, 
Gurupriyadharshini S. 



JO John June 12, 2019 08:51 PM UTC

Thank you.  Unfortunately I am still experiencing problems.  I updated the gridaction sample you provide with the code below to reproduce the problem.  After an edit the UI hangs with a progress circle and does not recover. In my scenario I have a dynamic number of columns determined at runtime.  Please advise.


@page "/"
@using System.Dynamic

<h1>Hello, world!</h1>
@using WebApplication11
@using Syncfusion.EJ2.RazorComponents.Grids

<EjsGrid id="Grid" DataSource="@gridData" AllowPaging="true" AllowSorting="true" Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })">
    <GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true"></GridEditSettings>
    <GridColumns>
        <GridColumn Field="A" HeaderText="A"  Width="120"></GridColumn>
        <GridColumn Field="Val" HeaderText="Val" TextAlign="@TextAlign.Right" Width="150"></GridColumn>
        
    </GridColumns>
</EjsGrid>

@functions{

    public List<dynamic> gridData { get; set; }
   

    protected override void OnInit()
    {
        gridData = new List<dynamic>();

        for (int r = 0; r < 3; r++)
        {

            dynamic row = new ExpandoObject();  // @using System.Dynamic
            var rowDict = (IDictionary<string, object>)row;

            rowDict["A"] = "A" + r;
            rowDict["Val"] = r * 34.5;

            gridData.Add(row);
        }


    }
}



GS Gurupriyadharshini Sankaranarayanan Syncfusion Team June 13, 2019 12:46 PM UTC

Hi John 
   
Thanks for your update. 
 
We have checked your query and in your code snippet, you have bound the columns to the Grid dynamically. We don’t have CRUD operations support for anonymous type binding, since blazor is fully strongly typed we have provided CRUD support initially for model based with limitation of anonymous type. We will consider this requirement as feature and it will considered in our Volume 4, 2019 roadmap. 
 
Until then we appreciate your patience. 
 
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through the below link:  
 
Regards, 
Gurupriyadharshini S. 
  



JO John June 13, 2019 08:28 PM UTC

Thanks.  In the meantime I am happy to use an alternative to ExpandoObject if there is one.

Is there another way of using a dynamic number of columns at runtime, otherwise this is quite limiting?

Thanks, John


CH Chris June 14, 2019 06:39 AM UTC

Hi Gurupriyadharshini ,

I have downloaded the sample project http://www.syncfusion.com/downloads/support/directtrac/general/ze/gridaction1462278422 

The grid page loads, displays the order data and allows me to go into edit mode.

However, whenever I click the Update button i receive the following error:

blazor.server.js:8 Uncaught (in promise) Error: System.ArgumentNullException: Value cannot be null.
Parameter name: name
   at System.Type.GetProperty(String name, BindingFlags bindingAttr)
   at Syncfusion.EJ2.RazorComponents.BaseComponent.Update(String value, String keyField)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.JSInterop.DotNetDispatcher.InvokeSynchronously(String assemblyName, String methodIdentifier, Object targetInstance, String argsJson)
   at Microsoft.JSInterop.DotNetDispatcher.BeginInvoke(String callId, String assemblyName, String methodIdentifier, Int64 dotNetObjectId, String argsJson)
    at endInvokeDotNetFromJS (https://localhost:5001/_framework/blazor.server.js:8:21783)
    at https://localhost:5001/_framework/blazor.server.js:8:21434
    at new Promise (<anonymous>)
    at e.beginInvokeJSFromDotNet (https://localhost:5001/_framework/blazor.server.js:8:21403)
    at https://localhost:5001/_framework/blazor.server.js:1:16653
    at Array.forEach (<anonymous>)
    at e.invokeClientMethod (https://localhost:5001/_framework/blazor.server.js:1:16624)
    at e.processIncomingData (https://localhost:5001/_framework/blazor.server.js:1:14624)
    at e.connection.onreceive (https://localhost:5001/_framework/blazor.server.js:1:11165)
    at WebSocket.i.onmessage (https://localhost:5001/_framework/blazor.server.js:1:30454)

Let me know if you need any further information. 

Regards.

Chris


GS Gurupriyadharshini Sankaranarayanan Syncfusion Team June 14, 2019 12:22 PM UTC

  
Hi John, 

Thanks for your update. 

Currently, we do not have workaround also to support the dynamic column binding. However, we have considered your request with high priority and will include in our Volume 3 2019 release roadmap. 

Until then we appreciate your patience. 
 
Regards, 
Gurupriyadharshini S. 



GS Gurupriyadharshini Sankaranarayanan Syncfusion Team June 14, 2019 12:54 PM UTC

Hi Chris 
   
Thanks for your update. 
 
We have checked your query and tried to reproduce the reported issue in our side, but it is unsuccessful.  
 
Please share the below details that will be helpful for to provide better solution. 
 
  1. Please share your scenario in video format.
  2. Share your package version.
 
Regards, 
Gurupriyadharshini S. 



JO John replied to Gurupriyadharshini Sankaranarayanan June 14, 2019 04:18 PM UTC

  
Hi John, 

Thanks for your update. 

Currently, we do not have workaround also to support the dynamic column binding. However, we have considered your request with high priority and will include in our Volume 3 2019 release roadmap. 

Until then we appreciate your patience. 
 
Regards, 
Gurupriyadharshini S. 


Great, thank you.


JW jwittland replied to Gurupriyadharshini Sankaranarayanan June 24, 2019 10:29 AM UTC

Hi Chris 
   
Thanks for your update. 
 
We have checked your query and tried to reproduce the reported issue in our side, but it is unsuccessful.  
 
Please share the below details that will be helpful for to provide better solution. 
 
  1. Please share your scenario in video format.
  2. Share your package version.
 
Regards, 
Gurupriyadharshini S. 


Hi,

I am experiencing same issues as the original author with Crud operations on EjsGrid in latest Blazor preview.


Update: causes an ArgumentNullException
Delete: causes JsonException
Insert: works (but how to get event?)

I have prepared a sample based on "Blazor (server-side)" and the FetchData.razor view using the EjsGrid.
See the attached project and README.txt inside with all stacktraces.

Any update on this?

Thank you in advance!

Attachment: EjsGridCrudFail_f9d70fbd.zip


VN Vignesh Natarajan Syncfusion Team June 25, 2019 08:45 AM UTC

Hi Jan,  

Thanks for contacting Syncfusion support.  

We have validated the defect “Script error thrown when perform CRUD operations in Grid” you have initiated with us. Since it is a known issue we have logged a defect report. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle ) and fix for the issue will be included in our Volume 2, 2019 Beta release which is expected to rolled out in the month end of June 2019.    
    
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.    
 

Till then we appreciate your patience. 

Regards, 
Vignesh Natarajan. 


Loader.
Up arrow icon