Silverlight theme is not applied

2 posts, 0 answers
  1. Mahesh Babu Immedisetty
    Mahesh Babu Immedisetty avatar
    13 posts
    Member since:
    Aug 2009

    Posted 11 Jan 2011 Link to this post

    Hi,

    I tried unsuccessfully to set theme for radgridview.

    My code is as given below:

    MainPage.xaml.cs
    namespace OnlineSimulation
    {
        public partial class MainPage : UserControl
        {



            public MainPage()
            {

                InitializeComponent();
              

                StyleManager.SetTheme(positionPanel, new Office_SilverTheme());

            }

        }
    }

    MainPage.xaml
    <UserControl x:Class="OnlineSimulation.MainPage"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                 xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:c1="clr-namespace:C1.Silverlight;assembly=C1.Silverlight"
                 xmlns:local="clr-namespace:OnlineSimulation">
        <UserControl.Resources>
            <Storyboard x:Name="FlipStart">
                <DoubleAnimation From="0" To="90" Duration="00:00:1" x:Name="Flip1Half"

                   Storyboard.TargetName="mainPanelProjection"
                   Storyboard.TargetProperty="RotationY">
                </DoubleAnimation>
            </Storyboard>
            <Storyboard x:Name="FlipEnd">
                <DoubleAnimation From="270" To="360" Duration="00:00:1" x:Name="Flip2Half"
                    Storyboard.TargetName="mainPanelProjection"
                    Storyboard.TargetProperty="RotationY">
                   
                </DoubleAnimation>
            </Storyboard>
        </UserControl.Resources>
        <Grid HorizontalAlignment="Center">
            
            <Grid.RowDefinitions>
                <RowDefinition Height="192"></RowDefinition>
                <RowDefinition Height="192"></RowDefinition>
                <RowDefinition Height="192"></RowDefinition>
                <RowDefinition Height="192"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="512" ></ColumnDefinition>
                <ColumnDefinition Width="215"></ColumnDefinition>
                <ColumnDefinition Width="297"></ColumnDefinition>



            </Grid.ColumnDefinitions>
            
            <telerik:RadGridView x:Name="positionPanel" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" ItemsSource="{Binding Position}" AutoGenerateColumns="False" Width="1024" RowIndicatorVisibility="Collapsed" ShowGroupPanel="False"
                                 IsFilteringAllowed="False" >
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn Header="Instrument" DataMemberBinding="{Binding Name}" Width="114">
                    </telerik:GridViewDataColumn>
                    <telerik:GridViewDataColumn Header="Price" Width="*"  DataMemberBinding="{Binding Price}"  />
                    <telerik:GridViewDataColumn Header="Average" DataMemberBinding="{Binding Average}" Width="114">
                    </telerik:GridViewDataColumn>
                    <telerik:GridViewDataColumn Header="Position" DataMemberBinding="{Binding Pos}" Width="114">
                    </telerik:GridViewDataColumn>
                    <telerik:GridViewDataColumn Header="MtoMProfits" DataMemberBinding="{Binding MtoMProfits}" Width="114">
                    </telerik:GridViewDataColumn>

                    <telerik:GridViewDataColumn Header="TradingProfits" DataMemberBinding="{Binding TradingProfits}" Width="114">
                    </telerik:GridViewDataColumn>
                    <telerik:GridViewDataColumn Header="Opening" DataMemberBinding="{Binding Opening}" Width="114">
                    </telerik:GridViewDataColumn>
                    <telerik:GridViewDataColumn Header="High" DataMemberBinding="{Binding High}" Width="114">
                    </telerik:GridViewDataColumn>
                    <telerik:GridViewDataColumn Header="Low" DataMemberBinding="{Binding Low}" Width="114">
                    </telerik:GridViewDataColumn>
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>


            
        </Grid>
    </UserControl>


    Could you please help??

    Thanks,
    Mahesh
  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 11 Jan 2011 Link to this post

    Hi Mahesh,

     
    Can you verify that you added a reference to the Telerik.Windows.Themes.Office_Silver.dll in your project?
    I have prepared an example for you using your code snippet and everything works fine by my side. 
    Please check the attached and let me know how I can assist you further.

    Kind regards,
    Vanya Pavlova
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Back to Top