The DataGrid control itself does not provide an API for loading of images, but only for visualizing them. Basically, there are three approaches that can be used for visualization of images inside the DataGrid:
1. You can use the built-in DataGridImageColumn
. The data passed to the image column should be an ImageSource, string or byte array. If the passed data is a string internally the column creates Uri and pass it as an UriSource to the Image. If the value is byte array a MemoryStream is created and that stream is set as a source for the Image control.
2. You can create a custom DataGridImageColumn (to inherit from it) and simply to override the PrepareCell method. Inside that method you can manually handle the passed by the ItemsSource value and basically set the Source of the image as desired.
3. The final approach that could be used is to create a TemplateColumn
. Inside the column you can put an Image control and again handle the source manually and as desired.
Hope the provided information will be helpful for you.
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Telerik Feedback Portal
and vote to affect the priority of the items