1
votes

I'm using Telerik ASP.NET OrgChart to display a simple chart organization, I've a rather small problem: my chart doesn't show any thing for expanding/collapsing the chart, so my chart (which can be large) is displayed with all nodes and it is not I want, I want to be able to hide/show my nodes so that user can navigate chart easily, I've exactly used the code in this sample:
http://www.telerik.com/help/aspnet-ajax/orgchart-expand-collapse.html
but my chart doesn't show hide/show icons, what is going wrong? Do you I miss anything? it is my code:

<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<telerik:RadOrgChart ID="RadOrgChart1" runat="server" EnableCollapsing="true">
    <Nodes>
        <telerik:OrgChartNode>
            <GroupItems>
                <telerik:OrgChartGroupItem Text="Item1">
                </telerik:OrgChartGroupItem>
                <telerik:OrgChartGroupItem Text="Item1">
                </telerik:OrgChartGroupItem>
            </GroupItems>
            <Nodes>
                <telerik:OrgChartNode>
                    <GroupItems>
                        <telerik:OrgChartGroupItem Text="Item1">
                        </telerik:OrgChartGroupItem>
                        <telerik:OrgChartGroupItem Text="Item1">
                        </telerik:OrgChartGroupItem>
                    </GroupItems>
                </telerik:OrgChartNode>
                <telerik:OrgChartNode Collapsed="true">
                    <GroupItems>
                        <telerik:OrgChartGroupItem Text="item1">
                        </telerik:OrgChartGroupItem>
                    </GroupItems>
                    <Nodes>
                        <telerik:OrgChartNode>
                            <GroupItems>
                                <telerik:OrgChartGroupItem Text="Item1">
                                </telerik:OrgChartGroupItem>
                                <telerik:OrgChartGroupItem Text="Item1">
                                </telerik:OrgChartGroupItem>
                            </GroupItems>
                        </telerik:OrgChartNode>
                    </Nodes>
                </telerik:OrgChartNode>
            </Nodes>
        </telerik:OrgChartNode>
    </Nodes>
</telerik:RadOrgChart>

I use Q3 2011, also when I want to run my code, I should remove Collapsed="true", I think it is not supported, and I think it is my problem, how can I solve this problem?

1

1 Answers

1
votes

You have only one item in the group where the collapse property is set to true. The property "collapsed" shall be applied to each node you intend to became collapsable. In you r case you have this:

 <telerik:OrgChartNode Collapsed="true">
                    <GroupItems>
                        <telerik:OrgChartGroupItem Text="item1">
                        </telerik:OrgChartGroupItem>
                    </GroupItems>

so there is nothing to collapse in there. Try to apply the collapse property in a group with more than one item. Reference Telerik documentation: "The functionality could be enabled by setting EnableGroupCollapsing property to true. The functionality is available when a Node has more than one GroupItem."