Accessing RenderedFields

2 posts, 0 answers
  1. Developer
    Developer avatar
    50 posts
    Member since:
    Apr 2014

    Posted 23 Aug 2016 Link to this post


    I have extracted the xml for radorgchart.  Within this I have some rendered fields
    When I attempt to use this xml to rebind another orgchart, within the databinding event I’d like to display the text of one rendered field within a label control.
    I’m nearly there; I can see the rendered fields for a particular node:



    But I can’t figure out how to extract something from this collection, where the label is equal to something.
    Any suggestions?

  2. Ivan Danchev
    Ivan Danchev avatar
    1853 posts

    Posted 25 Aug 2016 Link to this post


    If I understand correctly your scenario, you want to get the text from a specific node's rendered field and set it to a Label control. Since RenderedFields is a collection you can access the fields by their index, for example:
    protected void RadOrgChart1_NodeDataBound(object sender, OrgChartNodeDataBoundEventArguments e)
        if (e.Node.GroupItems[0].Text == "John Doe")
            Label1.Text = e.Node.GroupItems[0].RenderedFields[0].Text;

    So let's say you have two rendered fields declared:
            <telerik:OrgChartRenderedField DataField="position" />
            <telerik:OrgChartRenderedField DataField="budget" />

    then RenderedFields[0].Text will get the text of the node's "position" field.

    Ivan Danchev
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top