Grid 16.2.046 with DialogTemplate not updating (parameter null) but Insert is Ok

 Dear Support,
I have a Gid using CRUD with remoteSaveData Adaptor. I use this with all the lookup tables successfully with inline edit mode.
For a more complex Grid I decided to use a dialogTemplate, the inserting works fine but I am having problems with updating, no matter what I am doing I keep getting 
nulll value exception, parameter.Value in the controller is always null, I have tried several hours searching the forums to no avail, the problem only arises when using 
dialogTemplate. Please find attached screenshots of my code.

Attachment: GridUpdateError_9137f07.7z

7 Replies

PK Prasanna Kumar Viswanathan Syncfusion Team August 27, 2018 10:01 AM UTC

Hi Yoab, 
 
Thanks for contacting Syncfusion support. 
 
Based on your query while using dialogTemplate null value exception has been thrown in server-side while updating the record in Grid. We have created an sample in grid using your code example, but we unable to reproduce the mentioned issue at our end while updating the record in Grid.  
 
For your convenience we have attached the sample and please download the sample from the following link 
 
 
To find out the root cause, we need the following details 
 
1. In your screenshot you have attached the serializer code. So, please share the purpose of the code used in your application and where you have used in your application? 
 
2. Essential Studio Version details. 
 
3. If possible, replicate the issue in the attached sample.  
 
Regards, 
Prasanna Kumar N.S.V 



YY Yoab Youssoufou August 28, 2018 11:21 AM UTC

Hi Prasana,
I have gotten insert and update to work with Inline Form, I have not been able to get DialogTemplate working. But a very strange thing delete is now giving me the same param null even with InlineForm error while insert and update are ok, this is with exactly same code. I am at a loss. the answers to your questions:

1) I honestly don't understand the question what are you calling the serializer? the dialogTemplate form? I have attached the code
2) Essential Studio 16.2.046 EJ1 Dotnet core
3) The supplied issue does not contain persistance to sqlserver and for now 

P.S.: I would still rather use the DialogTemplate form I am suspecting something is wrong in my javascript... attached are both the cshtm and cs code. Thanks in advance.

Regards
Yoab
 

Attachment: SyncfusionCRUD_e30c7940.7z


AS Alan Sangeeth S Syncfusion Team August 29, 2018 10:05 AM UTC

Hi Yoab, 

We have prepared a sample with the provided code example and checked the issue on our side. But we are unable to reproduce the mentioned issue on our end. Please refer the below link for sample. 


We suspect that you are saying that Deleted property of value parameter is null. It is the default behavior and we pass only deleted record primary key value in Key property of value parameter. By using primary key value, you could find and delete the record in server end. 

Please refer the below code example and screenshot. 


<ej-grid id="FlatGrid" allow-paging="true" action-complete="complete"  allow-sorting="true" allow-searching="true" allow-filtering="true" databound="icontext" filter-settings="@(new FilterSettings() { FilterType = FilterType.Menu })"> 
    <e-datamanager json="ViewBag.datasource" update-url="/Home/Update" insert-url="/Home/Insert" remove-url="/Home/Delete" adaptor="remoteSaveAdaptor" /> 
    <e-edit-settings allow-adding="true" allow-deleting="true" allow-editing="true" edit-mode="InlineForm" show-delete-confirm-dialog="true" /> 
    <e-toolbar-settings show-toolbar="true" toolbar-items=@(new List<string> {"add", "edit", "delete", "update", "cancel"}) /> 
    <e-page-settings page-size="20" page-count="5" /> 
    <e-columns> 
        <e-column field="OrderID" is-identity="true" header-text="Order ID" is-primary-key="true" validation-rules='new Dictionary<string, object>() { {"required",true}, {"number",true} }' text-align="Right" width="75"></e-column> 
 
                            ... 
 
    </e-columns> 
</ej-grid> 
 
public ActionResult Update([FromBody] CRUDModel<OrdersView> param) 
        { 
            var ord = param.Value; 
            OrdersView val = ordersdata.Where(or => or.OrderID == ord.OrderID).FirstOrDefault(); 
            val.OrderID = ord.OrderID; 
            val.EmployeeID = ord.EmployeeID; 
            val.CustomerID = ord.CustomerID; 
            val.Freight = ord.Freight; 
            val.OrderDate = ord.OrderDate; 
            val.ShipCity = ord.ShipCity; 
            val.ShipName = ord.ShipName; 
            return Json(param.Value); 
        } 
        public ActionResult Insert([FromBody] CRUDModel<OrdersView> param) 
        { 
            ordersdata.Insert(ordersdata.Count, param.Value); 
            return Json(ordersdata); 
        } 
        public ActionResult Delete([FromBody] CRUDModel<OrdersView> param) 
        { 
            ordersdata.Remove(ordersdata.Where(or => or.OrderID == int.Parse(param.Key.ToString())).FirstOrDefault()); 
            return Json(param); 
        } 

Refer the screenshot below. 

 

If you do not receive primary key value in Key property also then please video demonstration of the issue. 

Regards, 
Alan Sangeeth S 



YY Yoab Youssoufou August 29, 2018 11:10 AM UTC

Thank you Allan, the example is ok with InlineForm now.
Please can we revert to the original problem, DialogTemplate not updating, I have submitted all the code.
If you can similarily give me a functional example CRUD with DialogTemplate that would be great, could it be some of my serializers that have syntax problem? Inserting works fine


AS Alan Sangeeth S Syncfusion Team August 30, 2018 07:07 AM UTC

Hi Yoab,  
As per your requirement we have prepared a sample dialogTemplate. We are not to reproduce the reported issue at our end. Kindly download the sample from below link 


If the issue still occurs, kindly get back to us with video demonstration or try to reproduce the reported issue in provided sample. 
 
Regards,
Alan Sangeeth S
 



YY Yoab Youssoufou September 3, 2018 04:00 AM UTC

Thanks It's all good now.




PK Prasanna Kumar Viswanathan Syncfusion Team September 3, 2018 05:29 AM UTC

Hi Yoab, 

Thanks for the update. 

Please get back to us if you require further assistance. 

Regards, 
Prasanna Kumar N.S.V 


Loader.
Up arrow icon