Hi guys,
I would like to set selected node (or nodes) by databinding (highlight a node as if the user clicked on it)...
I went through the online doco but couldn't find a property to bind to. Any help would be appreciated...
Thanks
Hi Henry,
There is a property called SelectedNodes: public SelectedOrgChartNodesCollection SelectedNodes {get;}
Binding directly to it will not work but you can use something like:
foreach (var node in mySelectedNodes)
{
OrgChart.SelectedNodes.Add(node);
}
You can see a working sample for using this property here.
Please let me know if I can provide any further assistance.
Best,
Ivo
Thanks for the reply Ivo. I just tried what you said. We use customized node object and bind a list of our node objects to the ItemsSource property. The chart displays ok. However, when I tried to set the selected node, the line OrgChart.SelectedNodes.Add(node); has compile error "Argument type "MyNode" is not assignable to parameter type Infragistics.Controls.Maps.OrgChartNode...
Does that mean I need to go through all nodes in the chart and find the one I want and then add it to the SelectedNodes collection? I presume OrgChartNode.Data contains my node. Is that right?
Thanks,
Henry