How to give line break in string inside wijmo grid cell?

1.2k Views Asked by At

This is my typescript file. I am binding this data to wijmo grid. I need to give line break in between 'shankar' and the date '12/10/2018'.

this.dataSource.push({
Name: 'John',
Select: 'Selected',
lastmodified: 'Shankar' +'/n'+ 
'12/10/2018'
  });

"/n" and "/br"are not working.

My Html code for wijmo

<wj-flex-grid-column *ngFor="let col of columnDefinitions" 
[minWidth]="200" width="*"
[header]="col.header" [binding]="col.binding" [visible]="col.visible" 
[allowDragging]="false" [wordWrap]="true" >
 </wj-flex-grid-column>

thanks in Advance!

1

There are 1 best solutions below

0
On

You also need to set the multiLine property of the column to true.

<wj-flex-grid-column *ngFor="let col of columnDefinitions" [minWidth]="200" width="[header]=" col.header " [binding]="col.binding " [visible]="col.visible " 
    [allowDragging]="false " [wordWrap]="true " [multiLine]="true">
</wj-flex-grid-column>

Also, the size of the rows will be smaller, so you will not be able to see the data of the next line. So, you will need to set the default size of rows using:

flexGrid.rows.defaultSize = 50;