Hi,
Lets say I have a large hierarchical diagram. Now I would like to have a dropdown associated with that diagram so that when I am looking for someone specifically I could bring the focus to that person node inside that diagram.
So far I have tried the following method (it is called via the dropdown):
public async Task FocusNode(ChangeEventArgs<string, EmployeeData> args)
{
if (args != null && args.Value != null)
{
var rect = diagramProjectOther.Nodes.Where(x => x.Data.ToString().Contains(args.Value)).FirstOrDefault();
if (rect != null)
{
System.Drawing.Rectangle Bounds = new System.Drawing.Rectangle()
{
X = (int)(rect.OffsetX - (rect.Width / 2)),
Y = (int)(rect.OffsetX - (rect.Height / 2)),
Height = (int)rect.Height,
Width = (int)rect.Width
};
await diagramProjectOther.BringIntoView(Bounds);
}
}
}
I would have thought that it would work, but all it does is that it centers the diagram, not on the node.
It might be because the diagram itself is contained within a DashboardLayoutPanel ?
Regards,
--Nicolas