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
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.
Thank you for the quick response, it works :)