Query |
Response | |
Connectors are not showing though my data has ParentId, Id and Root.
|
We have validated the reported issue. We found that the reported issue is in sample side. In sample we have to use EmpId and ParentId in same type. Please find the modified code snippet in the below table and behavior changes in the below release notes link.
Code snippet :
| |
I am able to add a node on click of a button but even the new node does not get connected to the parent (might be due to the first issue).
|
This issue is due to the first issue. If we do the above same code changes then this issue also fixed and we have ensured the same in the given sample. | |
Also I would like to know if it is possible to implement ItemAddedComment in my VM when I drop a shape from stencil into another node (Child added to parent by dragging and dropping)
|
Yes, we can implement the ItemAddedCommand in VM and also we can get the targetnode and parentnode in its argument. With this arguments we can implement the parent-child relation between sourcenode(child) and targetnode(parent). |
private void OnItemDrop(ItemDropEventArgs args)
{
var sourcenode = (args.Source as NodeViewModel);
if (args.Target is IEnumerable<object>)
{
foreach (object targetElement in args.Target as IEnumerable<object>)
{
if (targetElement is NodeViewModel)
{
ConnectorViewModel connector = new ConnectorViewModel();
connector.SourceNode = sourcenode;
connector.TargetNode = targetElement;
(this.Connectors as ConnectorCollection).Add(connector);
}
}
}
} |
public class customnode : NodeViewModel
{
[DataMember]
public object customcontent
{
get { return Content; }
set { Content = value; }
}
}
|