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

Themes

6 Answers 92 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michele
Top achievements
Rank 2
Michele asked on 10 Feb 2012, 01:14 PM
Hello Telerik,
I've got two question about theming... In my application I've curertly defined 2 brush for a RadGridView alternate row choosing the color similar to OfficeBlu theme, now that I changed the theme I have to find the colors again..is there a way of getting a theme default background color?

Second question: I've added a stackpanel for having a whole Menu bar as

<Grid Grid.Row="0" Background="#FFF0F0F0">
          <Grid.ColumnDefinitions>
              <ColumnDefinition Width="*"></ColumnDefinition>
              <!--<ColumnDefinition Width="100"></ColumnDefinition>-->
          </Grid.ColumnDefinitions>
          <StackPanel Orientation="Horizontal" Grid.Column="0" >
              <local:MenuView x:Name="Menu" cal:Bind.Model="{Binding Menu}">
              </local:MenuView>
          </StackPanel>
          <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="5,0,5,0" Grid.Column="1" Background="#FFF0F0F0" cal:Action.Target="{Binding}">
              <TextBlock x:Name="LoggedUser" Background="Transparent" Foreground="#242881" FontStyle="Italic" FontWeight="Bold" ></TextBlock>
              <TextBlock Name="TextBlockWithHyperlink" Text="  Info" Background="Transparent" cal:Message.Attach="[Event PreviewMouseDown] = [Action ShowInfo()]"  cal:Action.TargetWithoutContext="{Binding}"  >
              </TextBlock>
          </StackPanel>
      </Grid>

The same problem here...how do I tell pick the telerik:RadMenu default background color and apply it to my stackpanel?

Thanks
Paolo

6 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 10 Feb 2012, 02:26 PM
Hi Paolo,

 

Will you please share with us how you have defined the colors for alternated rows and what happens after setting the theme? Regarding your second question about colorizing StackPanel you should get the desired brush from the Menu and directly set it as a background for this container. 




Greetings,
Vanya Pavlova
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Michele
Top achievements
Rank 2
answered on 10 Feb 2012, 02:40 PM

Hello Telerik,
I defined it as

<telerik:RadGridView x:Name="DataItems" Grid.Row="1" AutoGenerateColumns="False"
             CanUserInsertRows="False" CanUserDeleteRows="False" if:GridViewCommandRow.IsEnabled="True"
             ShowColumnFooters="True" AlternateRowBackground="#FFEFF7FC" AlternationCount="2">               
         <telerik:RadGridView.Columns>
0
Michele
Top achievements
Rank 2
answered on 10 Feb 2012, 02:40 PM
for the second point I wish to get it in auto, without having to specify it in the code, is it possible?
Thanks
0
Vanya Pavlova
Telerik team
answered on 10 Feb 2012, 03:04 PM
Hello Paolo,

 

Please find my answers in the following order:


1. I tried to set the following settings related to the alternated rows and after setting the theme everything works correctly. I am attaching you the test project. May you please let me know how it differs from yours? 


2. If you want to use exactly this color you should set it manually, there is no way to style this container automatically in a specific color when you change the theme. In addition to this you may alter the background of a container based on a theme in a way similar to the one implemented in our online examples. You may read more about this in the following forum thread "Utilizing Telerik Theme Resources". The same is applicable to WPF as well. 



Regards,
Vanya Pavlova
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Michele
Top achievements
Rank 2
answered on 10 Feb 2012, 03:11 PM
Hello Vanya,
the demo you've sent me works (as also mine works...) I wish to get the alternate from the template...do the template define an alternate or a background color I can use for the alternate?

For the second point I'm taking a look at the example right now...thanks
0
Vanya Pavlova
Telerik team
answered on 10 Feb 2012, 03:16 PM
Hi Paolo,

 

The alternated color is directly set from the template of RadGridView. Since the styles are theme specific you will get the corresponding alternated color for each theme. The only one thing you should do is to set the AlternationCount to an appropriate value:


<telerik:RadGridView  AlternationCount="2" ItemsSource="{Binding Collection}"/>


Once you change the application theme setting you will get the appropriate color for each theme. 


Kind regards,
Vanya Pavlova
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
General Discussions
Asked by
Michele
Top achievements
Rank 2
Answers by
Vanya Pavlova
Telerik team
Michele
Top achievements
Rank 2
Share this question
or