Edit Template Only Refreshing Not Updating

I have made the following class to implement custom column templates to use with the datagrid component. 


I can successfully see the templates and I can edit the field but it never updates the entity. I have attached a gif that shows that I can edit other fields but as soon as I double click to go into the edit template of the custom column, once I press enter then the edits do not save on the entity. I have set break points in the "OnActionBegin" and "OnActionComplete" events and it seems that the requestType is always "Refresh" when I am using the custom column edit template. I have tried so many ways to get this to work but none of them fix the issue


Attachment: Edit_Error_9d59d533.zip

3 Replies

RS Renjith Singh Rajendran Syncfusion Team August 4, 2021 11:40 AM UTC

Hi Jeremy, 

Greetings from Syncfusion support. 
 
We are not clear about the exact scenario you are facing this reported problem. We need the following details to further proceed on this scenario and provide you a suggestion. Kindly get back to us with the following details for better assistance. 

  1. Share the complete Grid model(TagDto) class codes.
  2. Share the codes regarding from where you will be calling the Test method?
  3. What is the purpose of CustomColumns List variable you are populating inside Test method? Share the complete codes regarding this usage.
  4. Share the complete Grid rendering codes. We need to analyze the customizations you have done in grid.
  5. Share with us a simple issue reproducing sample for us to validate. This would be helpful for us to validate the problem based on your customized scenario.
  6. Or if possible, reproduce the problem with the below attached sample and share with us for further analysis.

The provided information will help us analyze the problem, and provide you a solution as early as possible. 

We also tried this scenario by rendering the EditTemplate content using RenderFragment. But we could not face the reported problem from our side. We are also attaching the sample for your reference.  
 
Query : I have set break points in the "OnActionBegin" and "OnActionComplete" events and it seems that the requestType is always "Refresh" when I am using the custom column edit template. 
We could see that you are using Batch mode of editing in grid. With batch mode we suggest you to use the Cell and Batch events(like OnBatchAdd, OnCellSave etc.) which will be triggered when performing batch edit actions in grid. 

Regards, 
Renjith R 



JB jeremy buentello August 4, 2021 03:29 PM UTC

I have figured out the issue that we were having with the refresh. This was due to our own issue we had implimented. I am now facing a different issue where the display template is not refreshing after the edit template has updated the items property. I have attached the updated project solution for reference to this issue. After you edit the "Custom Property" column, then it will not display the new value.


Attachment: CustomTemplates_d74a832b.7z


RS Renjith Singh Rajendran Syncfusion Team August 5, 2021 01:44 PM UTC

Hi Jeremy, 

Thanks for your update. 

We suggest you to ensure to set the Field property for the GridColumn to perform editing for the particular template column. 

Please refer and add the below code, 

 
<GridColumn Field="CustomProperty" HeaderText="@customColumn.Header"> 
                       <Template> 
                           @customColumn.DisplayTemplate(context as T) 
                       </Template> 
                       <EditTemplate> 
                           @customColumn.EditTemplate(context as T) 
                       </EditTemplate> 
                   </GridColumn> 


We have also modified the sample for your reference,  
 
Please get back to us if you need further assistance. 

Regards, 
Renjith R 


Loader.
Up arrow icon