Hi all,I would like a XamDataGrid's column to display images instead of values.
To obtain this result, I customized FieldSettings for that particular field, in this way:
<Style x:Key="masterTypeEditorStyle" TargetType="{x:Type igEditors:XamComboEditor}"> <Setter Property="HorizontalContentAlignment" Value="Center" /> <Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="DropDownButtonDisplayMode" Value="OnlyInEditMode" /> <Setter Property="ToolTip" Value="{Binding Path=DataItem.masterType}" /> <Setter Property="ItemsProvider"> <Setter.Value> <igEditors:ComboBoxItemsProvider> <igEditors:ComboBoxItemsProvider.Items> <igEditors:ComboBoxDataItem DisplayText="" Value="Master" Image="/assembly;component/path.to/master.png" /> <igEditors:ComboBoxDataItem DisplayText="" Value="Structure" Image="/assembly;component/path.to/structure.ico" /> <igEditors:ComboBoxDataItem DisplayText="" Value="Elementary" Image="/assembly;component/path.to/elementary.png" /> </igEditors:ComboBoxItemsProvider.Items> </igEditors:ComboBoxItemsProvider> </Setter.Value> </Setter> </Style>
<igDP:Field Name="masterType" Label="Type"> <igDP:Field.Settings> <igDP:FieldSettings AllowEdit="False" EditorType="{x:Type igEditors:XamComboEditor}" EditorStyle="{StaticResource masterTypeEditorStyle}" /> </igDP:Field.Settings></igDP:Field>
Images are correctly displayed, depending on the current value of View Model's "masterType" property. But they are smaller than their original size (16x16) and they look a little bit blurry.
Is there any way to control image size and rendering options on combo editor?
Thank you, bye. Maria
Hi Maria,
I'm putting together a sample using the code you provided and will get back to you with a response tomorrow.
Hi Rob, thanks so much.I'll wait your reply.