[]
        
(Showing Draft Content)

C1.WPF.OrgChart.C1OrgChart.IsCollapsed

IsCollapsed Property

IsCollapsed

Gets or sets a value that determines whether the node is currently displaying its children.

Declaration
public bool IsCollapsed { get; set; }
Remarks

You may use this property to create organizational charts with nodes that can be collapsed or expanded by users. One simple way to do this is by adding a CheckBox element to the item template and binding its CheckBox.IsChecked property to the IsCollapsed property of the C1OrgChart that represents the given item. For example:

<c1:C1OrgChart>
  <c1:C1OrgChart.ItemTemplate>
    <DataTemplate>
      <StackPanel>    
        <TextBlock Text="{Binding Name}" />
        <CheckBox 
          Margin="4 0" 
          IsChecked="{Binding IsCollapsed, 
            Mode=TwoWay, 
            RelativeSource={RelativeSource AncestorType=c1:C1OrgChart}}" />
      </StackPanel>    
    </DataTemplate>
  </c1:C1OrgChart.ItemTemplate>
</c1:C1OrgChart>

This XAML binds the IsChecked property of the CheckBox to the IsCollapsed property of the C1OrgChart control that contains the item. The user may then collapse or expand the chart by checking the CheckBox.