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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid with add edit external form template

Thread ID:





143767 Apr 4,2019 12:12 PM UTC Apr 8,2019 04:19 PM UTC Angular 3
Tags: ejGrid
Asked On April 4, 2019 12:12 PM UTC

Please i wanna use grid with add/editexternal form template and it gives me error when using template for column then after comment it throws exception this errorMessage: Cannot read property '_viewRef' of null
import { Component, Input, ViewChild, ViewEncapsulation } from '@angular/core';
import { GridComponent } from 'ej-angular2/src/ej/grid.component';
//import { EJ_Grid_DetailTemplate } from '../Shared/GridDetailTemplate';
moduleId: module.id,
selector: 'Model-Setting-Dialog',
templateUrl: '../../../../View/StructuredSketch/ModelSettingDialog.component.html',
styles: [
'.e-dialog.e-widget-content { background: none !important }'
export class ModelSettingDialog {
@Input() CurrentViews: object;
public currentViewsGrid: GridComponent;
public editSettings;
public toolbarItems;
constructor() {
this.editSettings = { allowEditing: true, allowAdding: true, allowDeleting: true, editMode: "externalformtemplate", externalFormTemplateID: "#template" };
this.toolbarItems = { showToolbar: true, toolbarItems: ["add", "edit", "delete", "update", "cancel"] };
getSelectedValue() { }
onActionComplete(e: any) {}

Manivannan Padmanaban [Syncfusion]
Replied On April 5, 2019 11:22 AM UTC

Hi Amira, 

Query: errorMessage: Cannot read property '_viewRef' of null 

We are unable to reproduce the reported issue at our end. For your convenience we have created the sample based on the shared code example, refer the below link. 

After referring the sample still facing the issue, please get back to us with the following details. 

  1. Please share the Angular version.
  2. Share the Essential studio version.
  3. If possible, reproduce the reported issue in the provided sample and revert back to us.

Manivannan Padmanaban. 

Replied On April 7, 2019 12:56 AM UTC

There is anyway to put <script id="template" type="text/ng-template"> in grid.html not in index.html?

Vignesh Natarajan [Syncfusion]
Replied On April 8, 2019 04:19 PM UTC

Hi Amira,  
Query: “There is anyway to put <script id="template" type="text/ng-template"> in grid.html not in index.html? 
Sorry it is not possible to place the <script> tag in the Grid.component.html instead of index.html. Because index.html file is the first file that runs along with main.ts file. So script tag must be initialized in that file to execute properly during the run time. 
Please get back to us if you have any other queries.  
Vignesh Natarajan. 


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