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

Customize the style of Expander

6 Answers 276 Views
Expander
This is a migrated thread and some comments may be shown as answers.
ankit
Top achievements
Rank 1
ankit asked on 05 Sep 2008, 03:34 AM
I am using RADExpander With SL 2 Beta 2.
I don't like Color of Expander  (Greenish Blue) and size. how to change ?

6 Answers, 1 is accepted

Sort by
0
Jim
Top achievements
Rank 1
answered on 05 Sep 2008, 03:45 AM
Halo
0
Accepted
Ivan
Telerik team
answered on 09 Sep 2008, 06:38 AM
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.
0
Gaurav
Top achievements
Rank 1
answered on 14 Jan 2009, 05:19 PM
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
0
Ivan
Telerik team
answered on 15 Jan 2009, 04:46 PM
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.
0
Rajesh
Top achievements
Rank 1
answered on 13 May 2009, 06:14 AM
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

 

 




 

0
Valentin.Stoychev
Telerik team
answered on 14 May 2009, 08:14 AM
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.
Tags
Expander
Asked by
ankit
Top achievements
Rank 1
Answers by
Jim
Top achievements
Rank 1
Ivan
Telerik team
Gaurav
Top achievements
Rank 1
Rajesh
Top achievements
Rank 1
Valentin.Stoychev
Telerik team
Share this question
or