While I was trying to merge columns, the auto-fit column feature considered the merged content per the single column.
In case of I don’t want this effect but applying the auto-fit feature across the columns merged, how should I do?
https://stackblitz.com/edit/angular-9cb7bp?file=app.component.ts
The following is the sample to fulfill:
App.component.ts
onClick() {
this.grid.autoFitColumns();
} |
App.component.html
<div class="control-section"> <button (click)="onClick()">AutoFit</button>
<ejs-grid [dataSource]='data' #grid [height]='height' [width]='width' [gridLines]='gridLines'
[allowTextWrap]='textWrap' allowGrouping="true" [groupSettings]="groupOptions"
(queryCellInfo)='queryCellInfoEvent($event)' [allowResizing]='true'>
<e-columns>
<e-column field='EmployeeID' headerText='Employee ID' width='150' textAlign='Right' isPrimaryKey={true}>
</e-column>
<e-column field='EmployeeName' headerText='Employee Name' width='200'></e-column>
<e-column field='9:00' headerText='9:00 AM' width='120'></e-column>
<e-column field='9:30' headerText='9:30 AM' width='120'></e-column>
<e-column field='10:00' headerText='10:00 AM' width='120'></e-column>
<e-column field='10:30' headerText='10:30 AM' width='120'></e-column>
<e-column field='11:00' headerText='11:00 AM' width='120'></e-column>
<e-column field='11:30' headerText='11:30 AM' width='120'></e-column>
<e-column field='12:00' headerText='12:00 PM' width='120'></e-column>
<e-column field='12:30' headerText='12:30 PM' width='120'></e-column>
<e-column field='2:30' headerText='2:30 PM' width='120'></e-column>
<e-column field='3:00' headerText='3:00 PM' width='120'></e-column>
<e-column field='3:30' headerText='3:30 PM' width='120'></e-column>
<e-column field='4:00' headerText='4:00 PM' width='120'></e-column>
<e-column field='4:30' headerText='4:30 PM' width='120'></e-column>
<e-column field='5:00' headerText='5:00 PM' width='120'></e-column>
</e-columns>
</ejs-grid>
</div> |