I Hope following solution will help you
Key Features:
1) DataTable : to store data from database and to bind this data with data grid
2) ValueConverter : Convert column value to specified image source
3) DataTemplate : Template for grid column having image type
1) DataTable : here i have used static table you can fetch data from database
DataTable dt = new DataTable();
dt.Columns.Add("Name");
DataRow dr = dt.NewRow();
dr["Name"] = "tick";
dt.Rows.Add(dr);
grid1.ItemsSource = null;
grid1.ItemsSource = dt.DefaultView;
2) Value Converter
[ValueConversion(typeof(string), typeof(SolidColorBrush))]
public class StringConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
string val = value.ToString();
return "/FormWithTab;component/Images/" + val + ".png";
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
}
3) DataTemplate
<pre><window x:class="FormWithTab.Window2" xmlns:x="#unknown">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wpf="http://schemas.microsoft.com/wpf/2008/toolkit" Loaded="Window_Loaded"
xmlns:local="clr-namespace:FormWithTab"
Title="Window2" Height="300" Width="300">
<window.resources>
<local:stringconverter x:key="NameToStringConverter" xmlns:local="#unknown" />
<datatemplate x:key="ImageColTemplate">
<image x:name="img" stretch="None" horizontalalignment="Center" source="{Binding Name, Converter={StaticResource NameToStringConverter}}" />
</datatemplate>
</window.resources>
<grid>
<wpf:datagrid x:name="grid1" verticalalignment="Top" height="150" autogeneratecolumns="False" xmlns:wpf="#unknown">
<wpf:datagrid.columns>
<wpf:datagridtemplatecolumn header="Image" celltemplate="{StaticResource ImageColTemplate}" />
</wpf:datagrid.columns>
</wpf:datagrid>
</grid>
</window>
If you need complete solution for this . i can forward you.