6 Answers, 1 is accepted
To change the look of RadExpander you should replace its template with a new one.
Attached, you can find a sample project, where a custom control applies a new template to RadExpander.
Hope this helps.
Sincerely yours,
Ivan
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I downloaded the sample but unfortunately it does not work. Basically with SL 2, there were some changes which broke this code. Will it be possible for you to update the code for SL 2 and repost it?
Thanks
Gaurav
Please find attached an example project demonstrating templates prepared for customization. I just made some changes in the Expander and TreeView templates in order to demonstrate the process.
I suggest you also review the following articles:
- Change hte SelectionVisual of the TreeView;
- Tweaking the Theme colors for Telerik Silverlight Controls;
- Changing color of TreeView Item.
I hope this helps.
Greetings,
Ivan
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I used the lastly uploaded sample "113371_160022-all-templates-for-customizing-20090115-1617.zip" and modified it for binding and some how it is not working.
In RadWindow.xaml file following lines are added.
1. At the top following code added for defining template
</ContentControl.Resources>
<DataTemplate x:Key="LayerPanelBarItemTemplate">
<StackPanel Orientation="Horizontal" Margin="5,0,0,0" >
<Image Source="{Binding Description}" Width="20" VerticalAlignment="Center"/>
<TextBlock Text=" " />
<TextBlock Text="{Binding Name}" Width="Auto" />
</StackPanel>
</DataTemplate>
</ContentControl.Resources>
2. At the end of file following code added.
<telerikNavigation:RadPanelBar x:Name="Panel" ItemsSource="{Binding Layers}" ItemTemplate="{StaticResource LayerPanelBarItemTemplate}">
</telerikNavigation:RadPanelBar>
In RadWindow.xaml.cs file following code are added in load function and two classes added.
void RadWindowBlend_Loaded(object sender, RoutedEventArgs e)
{
this.Panel.DataContext = new Test();
}
public class Test
{
public Layer[] Layers
{
get
{
return new Layer[]
{
new Layer("ExportModel"),new Layer("ImportModel"),new Layer("ModifyUser"),new Layer("Validation")
};
}
}
}
public class Layer
{
public Layer(string _name)
{
Name = _name;
Description =
"";
}
public string Name { get; set; }
public string Description{ get; set; }
}
With this code, the output displayed on the screen is "TelerikThemingApplication.Layer" 4 times.
How i get the actual layer names ? In one of my application I want to display name and image by using HeaderTemplate/ItemTemplate.
but somehow HeaderTemplate/ItemTemplate cannot be binded.
-Rajesh
Please download the latest binaries and your code will work.
All the best,
Valentin.Stoychev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.