How to load Images in SfDataGrid

How can I add an image column to SfDataGrid. I have bound the SfDataGrid to a collection, but the Image column does not appear.

<syncfusion:SfDataGrid VerticalAlignment="Stretch" HorizontalAlignment="Stretch" ItemsSource="{Binding Assets}"  />

public class AssetViewModel : ObservableObject { private BitmapImage image; public BitmapImage Image { get { return image; } } private string asset; public string Asset { get { return asset; } set { asset = value; image = new System.Windows.Media.Imaging.BitmapImage(new Uri("https://cryptoicons.org/api/icon/"+asset+"/50")); RaisePropertyChangedEvent(nameof(Asset)); RaisePropertyChangedEvent(nameof(Image)); } } }

1 Reply

VS Vijayarasan Sivanandham Syncfusion Team September 30, 2021 10:12 AM UTC

Hi Tyler Moore,

Thank you for contacting Syncfusion Support.

Your requirement can be achieved by using the converter in ValueBinding for GridImageColumn in SfDataGrid. For more information, please refer the below knowledge base documentation link, 
 

UG Link: https://help.syncfusion.com/wpf/datagrid/column-types#gridimagecolumn

Please let us know if you have any concerns in this. 

Regards, 
Vijayarasan S 


Loader.
Up arrow icon