Hi Nelson,
Greetings from Syncfusion support.
You need to follow the below steps to achieve this requirement.
Step #1: First you need to convert the byte array to base64 string. You can achieve this requirement like as following code snippet,
string base64String = Convert.ToBase64String(bytes, 0, bytes.Length); // Convert the bytes to base64 string |
Step #2: You need to add this converted base64 string with Grid data source.
Step #3: When you display the image in Grid to column, you need to convert this base64 string to image. We suggest you to use queryCellInfo event of the Grid to achieve this requirement. Please refer the following code snippet,
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
}
} |
In this code we have converted and appended the based64 string to Grid cell with the help of Grid queryCellInfo event. You can access the base64 string in this queryCellInfo event argument(i.e args.data).
Regards,
Thavasianand S.