Setting Alignment of Expand/Collapse button possible?

2 posts, 0 answers
  1. Wayne
    Wayne avatar
    36 posts
    Member since:
    May 2013

    Posted 11 Nov 2013 Link to this post

    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
  2. Ralitsa
    Admin
    Ralitsa avatar
    176 posts

    Posted 13 Nov 2013 Link to this post

    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 >>
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top