How to add notes with predefined values to cells in Angular Spreadsheet?
In this article, you can learn about how to add notes with pre-defined values to the cells in Angular Spreadsheet. This can be achieved by using the cell data-binding approach, where you can bind the notes property to the cell using the e-cell directive in the Spreadsheet component.
[app.component.html]
<ejs-spreadsheet #default [openUrl]="openUrl" [saveUrl]="saveUrl" (created)="created()">
<e-sheets>
<e-sheet name="Car Sales Report">
<e-rows>
<e-row [index]="3">
<e-cells>
<e-cell value="Cell A4" [notes]="noteContent"></e-cell>
<e-cell value="Cell B4" [notes]="noteContent"></e-cell>
</e-cells>
</e-row>
<e-row>
<e-cells>
<e-cell value="Cell A5" [notes]="noteContent"></e-cell>
<e-cell value="Cell B5" [notes]="noteContent"></e-cell>
</e-cells>
</e-row>
<e-row>
<e-cells>
<e-cell value="Cell A6" [notes]="noteContent"></e-cell>
<e-cell value="Cell B6" [notes]="noteContent"></e-cell>
</e-cells>
</e-row>
</e-rows>
<e-columns>
<e-column [width]=180></e-column>
<e-column [width]=130></e-column>
<e-column [width]=130></e-column>
<e-column [width]=180></e-column>
<e-column [width]=130></e-column>
<e-column [width]=120></e-column>
</e-columns>
</e-sheet>
</e-sheets>
</ejs-spreadsheet>
[app.component.ts]
import { Component, ViewEncapsulation, ViewChild } from '@angular/core';;
import { SpreadsheetComponent, SpreadsheetModule } from '@syncfusion/ej2-angular-spreadsheet';
@Component({
selector: 'app-root',
templateUrl: 'app.component.html',
styleUrls: ['app.component.css'],
encapsulation: ViewEncapsulation.None,
standalone: true,
imports: [ SpreadsheetModule, ]
})
export class AppComponent {
constructor() {
}
@ViewChild('default')
public spreadsheetObj: SpreadsheetComponent;
public noteContent: string = "Notes Added to the cell using cell data-binding approach";
public openUrl = 'https://services.syncfusion.com/angular/production/api/spreadsheet/open';
public saveUrl = 'https://services.syncfusion.com/angular/production/api/spreadsheet/save';
}
Sample Link: https://stackblitz.com/edit/angular-2ivu8k-ybpr98?file=src%2Fapp.component.html
Output:
For more information on notes and data-binding, please refer to the UG links mentioned below.
Notes in Angular Spreadsheet component | Syncfusion
Data binding in Angular Spreadsheet component | Syncfusion
Conclusion
I hope you enjoyed learning disable number formatting and apply text format in Angular Spreadsheet . You can refer to our Angular Diagram feature tour page to learn about its other groundbreaking feature representations and documentation, and how to quickly get started with configuration specifications. You can also explore our Spreadsheet example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, BoldDesk Support, or feedback portal. We are always happy to assist you!