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

[Solved] how to change the default theme from xaml

9 Answers 282 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Raj A R
Top achievements
Rank 1
Raj A R asked on 19 Nov 2009, 12:22 PM

HI team,

I need to add theme to my silverlight grid , i tried the below code but am getting the following error.
"The attached property theme was not found in the StyleManager."
i included this namespace:
 

 

xmlns

 

:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"

 

 

 

 

 

 

 

 

 

 

 

<telerik:RadGridView x:Name="RadGridView1" telerik:StyleManager.Theme="Office_Blue" AutoGenerateColumns="False">

 

my grid version is :2009.1.312.1020

-shinu.

 

 

 

9 Answers, 1 is accepted

Sort by
0
Missing User
answered on 19 Nov 2009, 12:40 PM
Hello Raj A R,

Office_Blue and Office_Silver themes are available since our Q2 release.
That' is why you are getting that error.

Regards,
Anastasia
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Raj A R
Top achievements
Rank 1
answered on 19 Nov 2009, 01:39 PM
hi Anastasia

so which theme I can use with this version?
i need a blue grid , can i use vista theme?


And also do i need to refer any namespace for using this   " telerik:StyleManager.Theme"
because am getting error on this line


-shinu
0
Missing User
answered on 19 Nov 2009, 01:58 PM
Hi Raj A R,

Vista theme is available in our Q1 release, so I think that it might be suitable in your case.

You will need to refer to this namespace:

xmlns:controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" 
  
<telerik:RadGridView x:Name="RadGridView1" controls:StyleManager.Theme="Vista"/>


Kind regards,
Anastasia
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Raj A R
Top achievements
Rank 1
answered on 19 Nov 2009, 02:18 PM
hi Anastasia ,

it seems like i cant  set controls:StyleManager.Theme="Vista"   this directly

i imported this namespace :

xmlns

 

:controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"   

 


and here is my grid declaration

 

<telerikGridView:RadGridView x:Name="rgvUnmappedAccounts"  

 

 

controls:StyleManager.Theme="Vista"

 

I'm getting this error
 AG_E_PARSER_BAD_PROPERTY_VALUE [Line: 73 Position: 74]    --- Inner Exception --- The given key was not present in the dictionary.

-shinu

0
Missing User
answered on 19 Nov 2009, 02:45 PM
Hello Raj A R,

Do you have a reference to the Vista theme assembly (Telerik.Windows.Themes.Vista.dll) in your project?
Also to what namespace refers "telerikGridView"?

It should be:

<....
xmlns:controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" 
  
xmlns:telerikGridView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
...>
  
<telerikGridView:RadGridView x:Name="rgvUnmappedAccounts" controls:StyleManager.Theme="Vista" />


Best wishes,
Anastasia
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Raj A R
Top achievements
Rank 1
answered on 19 Nov 2009, 02:55 PM
HI Anastasia

telerikGridView     refer to this assembly  xmlns:telerikGridView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"

from where do i get the Vista theme assembly (Telerik.Windows.Themes.Vista.dll) ??
====
I tried setting the theme from code behind also 
i have VistaTheme and summertheme available in the assemly
  

 

Public Sub New()  

Telerik.Windows.Controls.StyleManager.SetTheme(rgvKnowledgeAccounts,

 

 

New VistaTheme())  

InitializeComponent()

 

   

 

 

 

 

End Sub

 

 

 

 

but it is not setting and am getting this error "Object reference not set to an instance of an object."

-shinu.

0
Raj A R
Top achievements
Rank 1
answered on 19 Nov 2009, 06:01 PM
any update on this :)
0
Missing User
answered on 20 Nov 2009, 12:53 PM
Hello Raj A R,

Setting Vista theme to the RadGridView is working fine on my end - please take a look at the attached sample project.
Maybe you can configure my sample project so that it behaves like your project and attach it back so we can debug it localy.

Regards,
Anastasia
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Raj A R
Top achievements
Rank 1
answered on 29 Nov 2009, 07:48 PM
Hi Anastasia ,

thanks for the sample code, it really helps.

-shinu
Tags
GridView
Asked by
Raj A R
Top achievements
Rank 1
Answers by
Missing User
Raj A R
Top achievements
Rank 1
Share this question
or