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?
8 Answers, 1 is accepted
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.
Hristo
the Telerik team
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.
Hristo
the Telerik team
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
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
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.
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
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