Custom NodataControl with Theming

2 posts, 0 answers
  1. pluc
    pluc avatar
    5 posts
    Member since:
    Feb 2007

    Posted 27 Oct 2011 Link to this post

    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;
  2. Sia
    Admin
    Sia avatar
    745 posts

    Posted 01 Nov 2011 Link to this post

    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 >>

Back to Top