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

Setting Alignment of Expand/Collapse button possible?

1 Answer 19 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Hannah
Top achievements
Rank 2
Hannah asked on 11 Nov 2013, 11:23 PM
Is there any way to make the expand/collapse plus sign float towards the top-left of the node item?  We can set the text with:

e.NodeElement.ContentElement.TextAlignment = ContentAlignment.TopLeft;

(that code is within the NodeFormatting event, btw...)

So I'm wondering if there is an equivalent function for the expand/collapse element.  It doesn't look right sitting in the center of a node whose height is set to allow for multiple lines.  Would look better at the top-left IMO.

Thanks,

Wayne

1 Answer, 1 is accepted

Sort by
0
Ralitsa
Telerik team
answered on 13 Nov 2013, 05:03 PM
Hi Wayne, 

Thank you for contacting us.

Yes, you can move ExpanderElement on other position by setting its Margin property. The following code example demonstrates how to do it:

void radTreeView1_NodeFormatting(object sender, Telerik.WinControls.UI.TreeNodeFormattingEventArgs e)
{
    e.NodeElement.ExpanderElement.Margin = new Padding(0, -5, 0, 0);           
}

Should you have further questions, I would be glad to help. Regards,
Ralitsa
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
Treeview
Asked by
Hannah
Top achievements
Rank 2
Answers by
Ralitsa
Telerik team
Share this question
or