We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Problem showing photo in the grid

Hello, I have an employee datable that i would like to show in a data grid. one of the fields in the datable is a photo field that contains the employees' photo. 
My problem is that this photo column in the grid  shows only "System.Byte[]".

I guess i shall somehow format the column in the GridAutoGeneratingColumns event but i'm not reaching there... 
I'm using xamarin,ios in visual studio (Mac) and c#, and would appreciate any help... thanks






1 Reply

SS Sivaraman Sivagurunathan Syncfusion Team May 9, 2017 05:27 PM UTC

Hi Vitor, 
 
Thanks for contacting Syncfusion Support. 
 
We have checked your query and prepared sample for your reference. If your using older version of SfDataGrid you can use the Template Column for loading image to in SfDataGrid using UserCellType Property else Update the SfDataGrid latest (version 15.2.0.40)  then you can use the GridImageColumn to load the image to the SfDataGrid. 
 
The below code example illustrate  how to load the image in SfDataGrid using UserCellType property. 
 
 
GridTextColumn customerImageColumn = new GridTextColumn(); 
customerImageColumn.UserCellType = typeof(GridImageCell); 
customerImageColumn.MappingName = "CustomerImage"; 
customerImageColumn.HeaderText = "Image"; 
 
 
 
The below code example illustrate how to load the image in SfDataGrid using GridImageColum.  
 
 
GridImageColumn customerImageColumn = new GridImageColumn(); 
customerImageColumn.MappingName = "CustomerImage"; 
customerImageColumn.HeaderText = "Image"; 
 
 
 
Please find the sample from below link: 
 
 
 
Regards, 
 
Sivaraman 


Loader.
Live Chat Icon For mobile
Up arrow icon