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
125
Getting Exception While Adding Image In XAMDatagrid
posted

 

 

 

 

<

 

Window.Resources>

 

 

 

 

<ObjectDataProvider x:Key="MyData" ObjectType="{x:Type my:DataConnection}" MethodName="GetDataConnection" />

<Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key="ProductImage">

<Setter Property="Template"><Setter.Value> 

<ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}"> 

<Grid Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"> 

<Image Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Source="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content}"/></Grid> 

</ControlTemplate></Setter.Value> </Setter></Style>

</Window.Resources>

<Grid Name="MyLayout">

<igDP:XamDataGrid DataSource="{Binding Source={StaticResource MyData}}" Margin="12" Name="xamDataGrid1"><igDP:XamDataGrid.FieldLayoutSettings><igDP:FieldLayoutSettings AutoGenerateFields="False" /></igDP:XamDataGrid.FieldLayoutSettings><igDP:XamDataGrid.FieldLayouts>

<igDP:FieldLayout><igDP:FieldLayout.Fields><igDP:Field Name="Name" Label="Name" >

<igDP:Field.Settings><igDP:FieldSettings CellMinWidth="200" CellWidth="200" />

</igDP:Field.Settings></igDP:Field><igDP:Field Name="Photo" Label="My Photo">

<igDP:Field.Settings><igDP:FieldSettings CellMinWidth="200" CellWidth="200" CellValuePresenterStyle="{StaticResource ProductImage}" /></igDP:Field.Settings></igDP:Field></igDP:FieldLayout.Fields></igDP:FieldLayout>

 

 

 

</igDP:XamDataGrid.FieldLayouts</igDP:XamDataGrid></Grid>

Below is My XAML Code Where in I want to Display Name in First Columnfield and Image In another column. i have used Cellvaluepresenter as specified in Infragistic DOcuments..But I am getting exception  ""Error 2 Could not load type 'Microsoft.Windows.Design.Metadata.ProvideMetadataAttribute' from assembly 'Microsoft.Windows.Design.Extensibility, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'." 

Kindly Help Me to solve above Exception ..Please reply

->>>>>>>>>>>>>>>Here is my XAML Code -->>>>>>>>>>