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

EditTemplate doesn't work

We're currently working with Grid component in and try to customize the in-line edit, our current GridColumn is this

<GridColumn Field=@nameof(ProductGridRow.ShortDescription) HeaderText="Description" Width="300" AllowSorting="false" Type="ColumnType.String" EditType="EditType.DefaultEdit">
        <EjsTextBox Value="@((context as ProductGridRow).ShortDescription)">


but, every time we try to enter in edit mode, we get this error

We've tried also with a completely new grid but still the same error. How can we achieve that?

5 Replies

VN Vignesh Natarajan Syncfusion Team December 30, 2019 01:24 PM UTC

Hi Pierpaolo,  

Greetings from Syncfusion support.  

Query: “but, every time we try to enter in edit mode, we get this error 
The reported issue occur in older version of Syncfusion Nuget package when ModelType property of EjsGrid is not defined. But from our 2019 Volume 4 release we have deprecated this (ModelType) property. Hence we are not able to reproduce the reported issue in our latest version  
For your convenience we have prepared a sample which can be downloaded from below  
Kindly ensure that you have referred the latest version Nuget and script file properly. After ensuring, if you are still facing the issue, kindly get back to us with following details. 
  1. Share your Syncfusion Nuget package version along with script files version.
  2. Share your full Grid rendering code example.
  3. Are you facing this issue only while editing a record or while inserting a record also.   
  4. Share your model class.
  5. If possible try to reproduce the reported issue in provided sample or share the issue reproducible sample.

Vignesh Natarajan. 

PI Pierpaolo December 30, 2019 04:05 PM UTC

We found the problem, it's related to "complex types" and nullables.

Our DTOs has some non-nullable enums that, with EditTemplate, breaks everything. 

In fact, using the same example that you give us and modifying the class into this (notice the Test property)

raise the bug. If you put nullable with "?" notation everything works. 

The annoying thing is that if you leave it non-nullable and remove the EditTemplate the cell itself goes to edit mode and saves everything without any problem! 

Maybe it will be better to improve serialization data for grid.

PI Pierpaolo December 30, 2019 04:08 PM UTC

Please notice that this bug can be raised even if your DTOs has properties like this

VN Vignesh Natarajan Syncfusion Team December 31, 2019 12:23 PM UTC

Hi Pierpaolo,  

We have prepared a sample as your suggestion and we are able to reproduce the reported issue at our end while editing a record.  Currently we are validating your query, we will update you  the further details by 2nd January 2020.  

Till then we appreciate your patience.  

Vignesh Natarajan. 

VN Vignesh Natarajan Syncfusion Team January 2, 2020 01:00 PM UTC

Hi Pierpaolo,  

Thanks for the patience.  

We have validated the reported issue and we are able to reproduce the reported issue at our end while preparing a sample using your code example. We have confirmed it is issue and logged the defect report for the same Null reference error is thrown while using Editing template in Grid”. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle ) and including the defect fix in our upcoming patch release which is expected to be rolled out on or before 14th  January 2020.  
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this feedback. 
Till then we appreciate your patience. 

Vignesh Natarajan.  

Live Chat Icon For mobile
Up arrow icon