Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > General Discussions > Question about navigating root element tree

Answered Question about navigating root element tree

Feed from this thread
  • Jason avatar

    Posted on Feb 6, 2012 (permalink)

    Hi,

    I would like to programmatically get to some of the hidden properties that I can see in the Element Hierarchy Editor, but don't see an obvious way to do so.

    For instance, a RadButton has a root element and then a Fill Primitive, Layout, Focus, Border, etc. Drop down lists have other goodies in there. How does one get there in c#?

    Is it something like this, but then casting it to something else? For instance..
    (FillPrimitive) btnFoo.RootElement.children[0]

    It would be really nice to know how to navigate the tree because there are a lot of properties that we could take advantage of.
    Thanks.
    Jason



    Reply

  • Posted on Feb 7, 2012 (permalink)

    Hi Jason,

    Yes, the idea is that you can drill down through the hierarchy of elements as per the "Edit UI Elements" Smart Tag. For exmaple, to change the style of the border on a button to be dashed.

    Also which might help is this link on the hierarchy editor and this link on RadControlSpy

    If you need any further help, then let me know
    Richard
    Telerik.WinControls.Primitives.BorderPrimitive border = (Telerik.WinControls.Primitives.BorderPrimitive)this.radButton1.ButtonElement.Children[2];
    if (border != null)
    {
        border.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
    }

    Reply

  • Posted on Feb 8, 2012 (permalink)

    Hi Jason,

    Forgot to say, please remember to mark as answer if this helps. If you need more information though, then just let me know
    Richard

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > General Discussions > Question about navigating root element tree
Related resources for "Question about navigating root element tree"

Features  |  Demos  |  Documentation  |  Telerik TV  |  Knowledge Base  |  Code Library  |  Step-by-step Tutorial  |  Blogs   |  Self-Paced Trainer  ]