How to show images

May 8, 2014 at 5:00 AM
How to show images in a column? Or self-defined template in xaml file?
May 12, 2014 at 1:41 PM
what settings you want to do?
  • Open the demo
  • Select Tab "MDX Designer" and load Layout Setting "use Image in Custom Style"
  • Click button "Export Mdx Designer Layout"
  • in the Mdx Designer Layout there is a section <CustomCellsConditions></CustomCellsConditions> - it contains a description of the style
In the code creates a style so:

CellConditionsDescriptor target = new CellConditionsDescriptor();
CellCondition cond = new CellCondition();
cond.Appearance.Options.ShowValue = false;
cond.Appearance.Options.UseImage = true;
cond.ConditionType = CellConditionType.Equal;
cond.Value1 = 0;
cond.Appearance.CustomImageUri = "/Ranet.AgOlap;component/controls/images/olap/kpi/status/" + kpiControlType.Kpi.Custom_StatusGraphic + "_0.png";
cond.Appearance.CustomImage = new System.Windows.Media.Imaging.BitmapImage(new Uri(cond.Appearance.CustomImageUri, UriKind.Relative));
May 15, 2014 at 3:59 AM
Edited May 15, 2014 at 4:09 AM
My customer has a requirement, they hope product column,such as [Product].[Large Photo], can show corresponding images by product name. All product images are saved in a file. So i must define a template such as DataGridTemplateColumn of DataGrid control.
I have used Telerik RadPivotGrid control, it can self-defined template to show images:

<example:HeaderTemplateSelector x:Key="HeaderTemplateSelector">
                <Grid Height="80">
                        <ColumnDefinition Width="64"/>
                        <ColumnDefinition Width="85"/>
                    <Image Source="{Binding Data, Converter={StaticResource ProductToImageConverter}}"   Stretch="Fill"/>
                    <TextBlock Grid.Column="1" Text="{Binding Data, Mode=OneWay}" Margin="4 0 0 0"  VerticalAlignment="Center"/>

<pivot:RadPivotGrid x:Name="Pivot" Grid.RowSpan="2" DataProvider="{StaticResource DataProvider}" RowHeaderTemplateSelector="{StaticResource HeaderTemplateSelector}"
            ColumnHeaderTemplateSelector="{StaticResource HeaderTemplateSelector}"
            HorizontalLayout="{Binding ElementName=HorizontalLayout, Path=SelectedItem}"
            VerticalLayout="{Binding ElementName=VerticalLayout, Path=SelectedItem}"
            RowSubTotalsPosition="{Binding ElementName=RowSubTotalsPosition, Path=SelectedItem}"
            RowGrandTotalsPosition="{Binding ElementName=RowGrandTotalsPosition, Path=SelectedItem}"
            ColumnSubTotalsPosition="{Binding ElementName=ColumnSubTotalsPosition, Path=SelectedItem}"
            ColumnGrandTotalsPosition="{Binding ElementName=ColumnGrandTotalsPosition, Path=SelectedItem}"
            ShowAggregateValuesInline="{Binding ElementName=ShowAggregateValuesInline, Path=IsChecked}"/>
        <pivot:RadPivotFieldList x:Name="FieldList" Grid.Column="1" Margin="4 0 0 0" DataProvider="{StaticResource DataProvider}"/>

so can you tell me how to resolve this question. I will very appreciate if you can provide a detailed demo for me.
May 24, 2014 at 2:12 PM
Please give me help!
Jun 4, 2014 at 2:31 PM
Current version of PivotTable control can't show image in row or column areas.

It's possible to realize this function, but this requires time and resources.

Use case may be next: images are placed in dimension attribute (like "Large Photo" attribute of the "Product" dimension), and hierarchy settings of PivotTable contains setting which specifies the hierarchy property containing the image.