@Component({
selector: 'app-root',
template: '<button (click)="click($event)">Read records</button>
<ejs-grid #grid [dataSource]='data' allowPaging='true' height=365 [pageSettings]='initialPage'>
<e-columns>
. . .
</e-columns>
</ejs-grid>
'
})
export class AppComponent {
@ViewChild('grid')
public grid: GridComponent;
ngOnInit(): void {
this.data = data;
this.initialPage = { pageSizes: true, pageCount: 4 };
}
click(e){
console.log(this.grid.pageSettings.currentPage);
console.log(this.grid.currentViewData); // here you can store the records in your model
}
} |
string base64String = Convert.ToBase64String(bytes, 0, bytes.Length); // Convert the bytes to base64 string
|
function queryCellInfo(args) { // Grid queyCellInfo event
if (args.column.field == "Image") {
var image = new Image();
image.src = "data:image/png;base64," + args.data.Image; // base64 string
args.cell.appendChild(image); // Appended the image to particular cell
}
}
|