Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
185
Disable specific Nodes in xamOrgChart or hide them
posted

Hi,

How can I disable Nodes based on a Property in the data object.

I tried setting the IsEnabled Property in OrgChartNodeLayout, but that doesn't seem to work.

                <ig:OrgChartNodeLayout TargetTypeName="ArbeidsPaket"
                                       Key="TeilLeistungen"
                                       ToolTipPath="Tooltip" IsEnabled="{Binding VisibleInDiagram}" >
...

 

Best Regards

Parents
No Data
Reply
  • 335
    Verified Answer
    posted

    Hi,

     

    Have you tried to use the NodeControlAttachedEvent? This event is rised every time a NodeControl is created. You can check if the DataContext of the Node of the NodeControl satisfies some condition and if it does, you can set the IsEnablet property to true/false for the specific NodeControl.

     

    Example in XAML:

    <ig:XamOrgChart x:Name="myOrgChart" NodeControlAttachedEvent="myOrgChart_NodeControlAttachedEvent" />

     

    In code:

    private void myOrgChart_NodeControlAttachedEvent(object sender, Infragistics.Controls.Maps.OrgChartNodeEventArgs e)

    {

     

    if (e.Node.DataContext.GetType() == typeof(Order))

    e.Node.IsEnabled = false;

    }

     

    This will disable all nodes of type Order.

     

     

Children