Add button in Grid cell

Hello, how can I add a button in every cell of a column?

I tried to do this, but nothing is displayed on the screen. Thanks!

            <e-column field='viewdetails' headerText='Vezi detalii' textAlign='Right' width=120>
                <ng-template e-template let-data>
                    <div>
                        <button ejs-button class="btn btn-danger">X</button>
                    </div>
                    </ng-template>
            </e-column>

1 Reply 1 reply marked as answer

RS Rajapandiyan Settu Syncfusion Team March 18, 2022 04:59 AM UTC

Hi Robert, 
 
Thanks for contacting Syncfusion support. 
 
To bind column template in the Grid, you need to use ng-template name as ‘#template’. But you have used like ‘e-template’. This is the cause of problem. Please find the modified code to resolve this. 
 
 
      <e-column 
        field="viewdetails" 
        headerText="Vezi detalii" 
        textAlign="Right" 
        width="120" 
      > 
        <ng-template #template let-data> 
          <div> 
            <button ejs-button class="btn btn-danger">X</button> 
          </div> 
        </ng-template> 
      </e-column> 
 
 
 
Please get back to us if you need further assistance with this. 
 
Regards, 
Rajapandiyan S 


Marked as answer
Loader.
Up arrow icon