Place Expander icon right of header

9 posts, 1 answers
  1. Anders
    Anders avatar
    12 posts
    Member since:
    Apr 2011

    Posted 05 Apr 2011 Link to this post

    Hi

    Is it possible to place the expander icon to the right of the header content?
    And is it possible to make it expand only when you click on the icon?
    I'm using it inside a treeview, and it overrides the double click of my treeview.

    Oh and it looks likes it having problems when used together with a treeview.
    When you expand the treeview node for the first time, it moves the child node to far down for a 1 sec, just to be moved back to its correct place.
    I can make a small example of this, if you wish. 


    EDIT

    Spend some more time with it, and I figured out how to place the expander to the right and fixed the overriding problem.
    Just used a StackPanel and placed my expander to the right of the rest of the content and made the expander header empty.
    Though this solves some problemes, it introduces a new.

    How I want it to look

    What it look like now

    What do I need to do, for the expanded context to be places under all my content, like shown in the first image?

  2. Hristo
    Admin
    Hristo avatar
    345 posts
    Member since:
    Sep 2012

    Posted 06 Apr 2011 Link to this post

    Hi Anders,

    Unfortunately there is no such property. You should change the control template of the expander in order to achieve your goal. You can take a look at the following article about changing the style and control template of our controls via Blend: http://www.telerik.com/help/silverlight/common-styling-appearance-edit-control-templates-blend.html
    I'm also attaching a sample project demonstrating how to move the button to the right of the content.

    As to the tree view, it would be great if you send us a sample project. However the look in first image could not be achieved exactly because the TreeViewItem itself has some indentation (the minimum is the size of the expand arrow).

    Hope this helps.

    All the best,
    Hristo
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

  3. Download a free trial of UI for WPF
  4. Hristo
    Admin
    Hristo avatar
    345 posts
    Member since:
    Sep 2012

    Posted 06 Apr 2011 Link to this post

    Hi Anders,

    Unfortunately there is no such property. You should change the control template of the expander in order to achieve your goal. You can take a look at the following article about changing the style and control template of our controls via Blend: http://www.telerik.com/help/silverlight/common-styling-appearance-edit-control-templates-blend.html
    I'm also attaching a sample project demonstrating how to move the button to the right of the content.

    As to the tree view, it would be great if you send us a sample project. However the look in first image could not be achieved exactly because the TreeViewItem itself has some indentation (the minimum is the size of the expand arrow).

    Hope this helps.

    All the best,
    Hristo
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

  5. Anders
    Anders avatar
    12 posts
    Member since:
    Apr 2011

    Posted 07 Apr 2011 Link to this post

    Thanks for your sample, though it gives a compile error.

    Error 1 Cannot find the static member 'HorizontalHeaderAlignmentProperty' on the type 'RadExpander'.

    I'm using version 2011.1.328.40 The latest I could find on your site.

    I created a sample project to illustrate the RadExpander and RadTreeview problem.

    databasa.dk/tmp/TelerikTreeViewDemo.zip

    When you expand the treeview root for the first time, its clear that its having problems with the height. 

    Here you can see it in the process of expanding the root, for the first time.
    http://databasa.dk/tmp/Expanding%20error.png

    This it what i looks like when its finish expanding
    http://databasa.dk/tmp/Expand%20finish.png

  6. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3005 posts
    Member since:
    Dec 2014

    Posted 12 Apr 2011 Link to this post

    Hello Anders,

    Can you test the example Hristo attached with the latest internal build - 2011.1.411.40, you can download it form your account. The HorizontalHeaderAlignment property is introduced there.

    Also thank you for sending the sample project, it helped us identify the issue. I logged it in our PITS under the name Expander: When the control is loaded, it is first expanded and then collapsed. The item will be available for tracking from tomorrow the latest. I also updated your Telerik account accordingly.

    Kind regards,
    Tina Stancheva
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

  7. Anders
    Anders avatar
    12 posts
    Member since:
    Apr 2011

    Posted 14 Apr 2011 Link to this post

    Thanks for the update.
    Now were are getting closer :-)

    But if the Content is longer than the Header is pushes the expander icon, when its expanded.

    Try with this code in your sample app.

    <telerik:RadExpander Margin="43,24,0,0"
                        HorizontalAlignment="Left"
                        VerticalAlignment="Top"
                        Content="Very Very Long Content"
                        Header="Header"
                        Style="{DynamicResource RadExpanderStyle1}" />

    The Icon jumps depending on it being expanded or not.

  8. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3005 posts
    Member since:
    Dec 2014

    Posted 19 Apr 2011 Link to this post

    Hi Anders,

    You can set the RadExpander.HorizontalHeaderAlignment to "Left". This way the ExpanderButton will be left aligned and when the RadExpander is expanded and its width extends due to the content's width, the button won't move.

    Give this a try and let us know if it works for you.

    Regards,
    Tina Stancheva
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

  9. Answer
    Vladislav
    Admin
    Vladislav avatar
    199 posts
    Member since:
    Dec 2014

    Posted 09 May 2011 Link to this post

    Hi Anders,

    We want to inform you, that the issue named: "Expander: When the control is loaded, it is first expanded and then collapsed" is already fixed.
    You can check it in our latest internal build (released on 2 of May).
    Any feedback/comments on the subject are highly appreciated.

    Best wishes,
    Vladislav
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

  10. Anders
    Anders avatar
    12 posts
    Member since:
    Apr 2011

    Posted 09 May 2011 Link to this post

    Thats great looks like its expanding correct now, thx :-D

Back to Top
Download a free trial of UI for WPF