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

Custom NodataControl with Theming

1 Answer 33 Views
Chart
This is a migrated thread and some comments may be shown as answers.
pluc
Top achievements
Rank 1
pluc asked on 27 Oct 2011, 03:17 PM
Hello,

How Can I use custom NodataTemplate with theming (Metro)?


<UserControl.Resources>
<Style x:Key="sszchartloading" TargetType="telerik:NoDataControl">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="telerik:NoDataControl">
                        <StackPanel Orientation="Vertical" HorizontalAlignment="Center">
                            <TextBlock x:Name="tbAbort" Text="Vorschau wird geladen..." Foreground="Black"></TextBlock>
                            <telerik:RadProgressBar IsIndeterminate="True"  telerik:Theming.Theme="Metro" Height="40" Width="400" />
                            <Button x:Name="btnAbort" Content="Abbrechen" Click="btnAbort_Click" Width="100" HorizontalAlignment="Right"></Button>
                        </StackPanel>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
 <telerik:RadChart x:Name="RadChart1" telerik:Theming.Theme="Metro" >
             <telerik:RadChart.DefaultView>
                        <telerik:ChartDefaultView>
                            <telerik:ChartDefaultView.ChartArea>
                                <telerik:ChartArea LegendName="legend" Grid.Row="0" Grid.RowSpan="2" 
                                       x:Name="ChartArea"
                                       EnableAnimations="true"
                                       Padding="5,15,20,10" NoDataControlStyle="{StaticResource sszchartloading}">
                                </telerik:ChartArea>
                            </telerik:ChartDefaultView.ChartArea>
                        </telerik:ChartDefaultView>
                    </telerik:RadChart.DefaultView>
                </telerik:RadChart>

This doesn't work:
RadChart1.DefaultView.ChartArea.NoDataControlStyle = this.Resources["sszchartloading"] as Style;

1 Answer, 1 is accepted

Sort by
0
Sia
Telerik team
answered on 01 Nov 2011, 04:28 PM
Hi Kzimny,

Please excuse me for the late reply.

Try setting ApplicationTheme in your project before InitializeComponent();
StyleManager.ApplicationTheme = new MetroTheme();
and remove all telerik:Theming.Theme="Metro".

Kind regards,
Sia
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Chart
Asked by
pluc
Top achievements
Rank 1
Answers by
Sia
Telerik team
Share this question
or