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

treeview to image

1 Answer 70 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Paul Lewis
Top achievements
Rank 1
Paul Lewis asked on 15 Apr 2010, 05:05 PM
Hi,

I know the treeview is a UI control but I have implemented it for building salesforce working structures and my users are constantly requesting I make it so they can email the tree,  Does anyone know of an easy way to do this?

The person who need to consume the image is not inside our network or I would give them access to the page to view it live

any suggestions appreciated

Paul

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 16 Apr 2010, 11:29 AM
Hello Paul,

You can send exact replica of the treeview using the GetXml() and the LoadXmlString() methods of the control. To better understand what I mean, please try the following simple code: 

<form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadTreeView ID="RadTreeView1" runat="server">
        <Nodes>
            <telerik:RadTreeNode runat="server" Text="Root RadTreeNode1">
                <Nodes>
                    <telerik:RadTreeNode runat="server" Text="Child RadTreeNode 1">
                    </telerik:RadTreeNode>
                    <telerik:RadTreeNode runat="server" Text="Child RadTreeNode 2">
                    </telerik:RadTreeNode>
                    <telerik:RadTreeNode runat="server" Text="Child RadTreeNode 3">
                    </telerik:RadTreeNode>
                </Nodes>
            </telerik:RadTreeNode>
            <telerik:RadTreeNode runat="server" Text="Root RadTreeNode2">
                <Nodes>
                    <telerik:RadTreeNode runat="server" Text="Child RadTreeNode 1">
                    </telerik:RadTreeNode>
                    <telerik:RadTreeNode runat="server" Text="Child RadTreeNode 2">
                    </telerik:RadTreeNode>
                </Nodes>
            </telerik:RadTreeNode>
            <telerik:RadTreeNode runat="server" Text="Root RadTreeNode3">
            </telerik:RadTreeNode>
        </Nodes>
    </telerik:RadTreeView>
    <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
    </form>

protected void Button1_Click(object sender, EventArgs e)
  {
      RadTreeView treeview2 = new RadTreeView();
      treeview2.LoadXmlString(RadTreeView1.GetXml());
      Page.Form.Controls.Add(treeview2);
  }


Cheers,
Peter
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
TreeView
Asked by
Paul Lewis
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or