Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > Expander > Customize the style of Expander

Answered Customize the style of Expander

Feed from this thread
  • ankit avatar

    Posted on Sep 4, 2008 (permalink)

    I am using RADExpander With SL 2 Beta 2.
    I don't like Color of Expander  (Greenish Blue) and size. how to change ?

    Reply

  • Jim avatar

    Posted on Sep 4, 2008 (permalink)

    Halo

    Reply

  • Answer Ivan Ivan admin's avatar

    Posted on Sep 9, 2008 (permalink)

    Hi Jim,

    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.

    Reply

  • Gaurav avatar

    Posted on Jan 14, 2009 (permalink)

    Hi,

    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

    Reply

  • Ivan Ivan admin's avatar

    Posted on Jan 15, 2009 (permalink)

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

    I hope this helps.

    Greetings,
    Ivan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.

    Reply

  • Rajesh avatar

    Posted on May 13, 2009 (permalink)

    Hi,

    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

     

     




     

    Reply

  • Valentin.Stoychev Valentin.Stoychev admin's avatar

    Posted on May 14, 2009 (permalink)

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

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > Expander > Customize the style of Expander
Related resources for "Customize the style of Expander"

Silverlight Expander Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]