Category / Section
How to load web image in GridImageColumn of WPF DataGrid (SfDataGrid)?
1 min read
You can load the local images in GridImageColumn by giving the local path to the bounded property in WPF DataGrid (SfDataGrid). You can also load the web images in GridImageColumn by giving the web image path instead of local path like below code example.
XAML
<Syncfusion:SfDataGrid x:Name="datagrid" AllowEditing="True" AllowFiltering="True" AutoGenerateColumns="False" ItemsSource="{Binding GDCSource}"> <Syncfusion:SfDataGrid.Columns> <Syncfusion:GridTextColumn MappingName="EmployeeName" /> <Syncfusion:GridTextColumn MappingName="EmployeeAge" /> <Syncfusion:GridTextColumn MappingName="EmployeeGender" /> <Syncfusion:GridDateTimeColumn MappingName="EmployeeDate" /> <Syncfusion:GridCheckBoxColumn MappingName="Review" /> <Syncfusion:GridImageColumn MappingName="ImageLink" /> </Syncfusion:SfDataGrid.Columns> </Syncfusion:SfDataGrid>
C#
ImageLink = new System.Windows.Media.Imaging.BitmapImage(new Uri("http://efdreams.com/data_images/dreams/computer/computer-03.jpg")