Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
880
Problem with showing Image in xamDataGrid
posted

I want to Show an Image in one field of XamDataGrid. the path of the Image i have as Property in my Model Object. i was able to Show the Image using normal WPF DataGrid, but facing issues with XamDataGrid.( see in point 2)

1. Binding ItemImage Property to XamDataGrid Field.

<igDP:Field Name="ItemImage" Label="Device Image">
<igDP:Field.Settings>
<igDP:FieldSettings AllowEdit="False">
<igDP:FieldSettings.CellValuePresenterStyle>
<Style TargetType="{x:Type igDP:CellValuePresenter}" >
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
<Grid>
<Image
Source="{Binding RelativeSource={RelativeSource AncestorType={x:Type igDP:XamDataGrid}}, Path=ItemImage, Converter={StaticResource ImageConverter}}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</igDP:FieldSettings.CellValuePresenterStyle>
</igDP:FieldSettings>
</igDP:Field.Settings>
</igDP:Field>

3. Working with normal WPF Data Grid.

<DataGridTemplateColumn>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Image Source="{Binding ItemImage, Converter={StaticResource ImageConverter}}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>

please let me know. if i have to make any change in Step 2.