This is a migrated thread and some comments may be shown as answers.

How to use SeriesItemLabelStyle and HorizontalBarSeriesStyle as a DynamicResource

3 Answers 65 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Dhruv
Top achievements
Rank 1
Dhruv asked on 15 Feb 2013, 01:54 PM
Hi,

I am using RadChart in my application.I am loading all styles from a resource theme file.
The problem is that i am unable to use SeriesItemLabelStyle and HorizontalBarSeriesStyle of RadChart as DynamicResource.
this is a critical issue Since we can have different themes for our application.
 
Thanks
Dhruv 
 

3 Answers, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 20 Feb 2013, 09:42 AM
Hi Dhruv,

 I tried to reproduce your scenario based on what you said and the Dynamic Resources get applied as expected. Could you please try to modify the attached project so that the issues exhibit there? You may also send us a stripped down runnable version of yours where this reproduces so that we can inspect it locally.

Regards,
Evgenia
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Dhruv
Top achievements
Rank 1
answered on 05 Mar 2013, 01:55 PM
Hey Evgenia,

SeriesItemLabelStyle property worked with dynamic resource but HorizontalBarSeriesStyle is still throwing exception in runtime .
In your example you used only SeriesItemLabelStyle.

Thanks,
Dhruv 

 

 

 

 

0
Peshito
Telerik team
answered on 08 Mar 2013, 09:07 AM
Hello Dhruv,

As my colleague Evgenia said earlier, the sample attached demonstrates the use of a dynamic resources where the behavior you have described is not reproducible. In the attached sample there is style named "MyHorizontalBarStyle" targeting the HorizontalBar.
<Style x:Key="MyHorizontalBarStyle"
    TargetType="telerik:HorizontalBar">
    <Setter Property="Template" >
        <Setter.Value>
            <ControlTemplate TargetType="telerik:HorizontalBar">
                <Canvas Opacity="0" x:Name="PART_MainContainer">
                    <Rectangle x:Name="PART_SelectedState"
                               Height="{TemplateBinding ItemActualHeight}"
                               Width="{TemplateBinding ItemActualWidth}"
                               Visibility="{TemplateBinding MaskVisibility}"
                               Fill="#1FA3EB" />
                    <Canvas.RenderTransform>
                        <ScaleTransform x:Name="PART_AnimationTransform" ScaleX="0"  />
                    </Canvas.RenderTransform>
                </Canvas>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>
and this style is successfully used in the HorizontalBarSeriesDefinition.
<telerik:HorizontalBarSeriesDefinition ItemStyle="{DynamicResource MyHorizontalBarStyle}"
                                                               SeriesItemLabelStyle="{DynamicResource MySeriesItemLabelStyle}"
                                                               ShowItemLabels="True"/>

Could you please modify the example so the issue is reproducible or elaborate a bit more on the issue.

Note that as this is a forum thread you either can submit a support ticket where you can attach files, or use a third party web site for uploading and sharing files.

All the best,
Peshito
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Chart
Asked by
Dhruv
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Dhruv
Top achievements
Rank 1
Peshito
Telerik team
Share this question
or