Customize the style of Expander

7 posts, 1 answers
  1. ankit
    ankit avatar
    29 posts
    Member since:
    Sep 2008

    Posted 04 Sep 2008 Link to this post

    I am using RADExpander With SL 2 Beta 2.
    I don't like Color of Expander  (Greenish Blue) and size. how to change ?
  2. Jim
    Jim avatar
    2 posts
    Member since:
    Aug 2008

    Posted 04 Sep 2008 Link to this post

    Halo
  3. DevCraft banner
  4. Answer
    Ivan
    Admin
    Ivan avatar
    519 posts

    Posted 09 Sep 2008 Link to this post

    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.
  5. Gaurav
    Gaurav avatar
    8 posts
    Member since:
    Nov 2008

    Posted 14 Jan 2009 Link to this post

    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
  6. Ivan
    Admin
    Ivan avatar
    519 posts

    Posted 15 Jan 2009 Link to this post

    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.
  7. Rajesh
    Rajesh avatar
    25 posts
    Member since:
    Dec 2007

    Posted 13 May 2009 Link to this post

    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

     

     




     

  8. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 14 May 2009 Link to this post

    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.
Back to Top
DevCraft banner