Requirement In ejs-Grid

Hi Team,
              I am using ejs-grid there I have one requirement that is I need to add in one column as images for more understanding please refer to the attachment. 

Attachment: Sample_Image_c89f79a.zip

1 Reply 1 reply marked as answer

PG Praveenkumar Gajendiran Syncfusion Team November 2, 2020 12:42 PM UTC

Hi Harish,

Greetings from Syncfusion support. 

We checked your query and provided information. Based on that we infer that you want to display an image in the Grid column. For this we suggest you to use Column Template feature of Grid to display the custom element instead of a field value in the column.

Please refer the below code example, screenshot and sample for more information.

Code Example: 
<ejs-grid #grid [dataSource]="data"> 
    <e-columns> 
      <e-column headerText="Employee Image" width="150" textAlign="Center"> 
        <ng-template #template let-data> 
          <div class="image"> 
            <img 
              alt="{{data.EmployeeID}}" 
            /> 
          </div> 
        </ng-template> 
      </e-column> 
    </e-columns> 
  </ejs-grid> 

Screenshot: 
 

Sample: https://stackblitz.com/edit/angular-ajeo4q-4xfmzp?file=app.component.html

Refer the below document for Column Template feature  of Grid.

Documentation Link: https://ej2.syncfusion.com/angular/documentation/grid/columns/#column-template

Please get back to us if you need further assistance.

Regards,
Praveenkumar G 


Marked as answer
Loader.
Up arrow icon