Hi Krishna,
1. Please conduct our sales team "salessupport@syncfusion.com" to request 25% waiver query.
2. If you want to show the tool tip when the user hover the mouse on the node then you can write a delegate to fire this event. Please refer to the following code snippet.
public delegate void NodeHover(object sender, MouseEventArgs args);
public event NodeHover nodehover;
public MainForm()
{
InitializeComponent();
this.nodehover += new NodeHover(MainForm_nodehover);
}
ToolTip tooltip = new ToolTip();
void MainForm_nodehover(object sender, MouseEventArgs args)
{
tooltip.Active = true;
tooltip.SetToolTip(this.diagram1, symbol2.Name);
}
private void diagram1_MouseMove(object sender, MouseEventArgs e)
{
RectangleF rect = new RectangleF(this.diagram1.Controller.MouseLocation.X, this.diagram1.Controller.MouseLocation.Y,1,1);
if (symbol2.BoundingRectangle.IntersectsWith(rect))
{
this.nodehover(sender, e);
}
else
tooltip.Active = false;
}
I have attached the sample that demonstrates this completely. In this sample when you hover the mouse the tooltip will display with the node's name. You can download the sample from the following page.
http://websamples.syncfusion.com/samples/Diagram.Windows/F66125/main.htmPlease let me know if you ahve any questions.
3. When you press delete key to remove the node , the NodeCollectionChanging event gets fired. You can handle some actions before the node deletion. Please refer to the following code snippet.
this.diagram1.Model.EventSink.NodeCollectionChanging += new CollectionExEventHandler(EventSink_NodeCollectionChanging);
[EventHandlerPriority(true)]
void EventSink_NodeCollectionChanging(CollectionExEventArgs evtArgs)
{
if (evtArgs.ChangeType == CollectionExChangeType.Remove)
{
MessageBox.Show("Delete Nodes");
}
}
I have attached the sample for your reference. You can download the sample form the following page.
http://websamples.syncfusion.com/samples/Diagram.Windows/RemoveNodes/main.htmPlease refer to the sample and let me know if you ahve any questions.
4. If you want to automatically change the line routing of the Orthogonal Connector and prevent the overlapping of the line , then you have to set Model.LineRoutingEnabled property to true. Please refer to the following code snippet.
this.diagram.Model.LineRoutingEnabled = true;
OrthogonalConnector line = new OrthogonalConnector(symbol1.PinPoint, symbol2.PinPoint);
symbols.Add( line );
this.diagram.Model.AppendChildren(symbols, out position);
symbol1.CentralPort.TryConnect(line.HeadEndPoint);
symbol2.CentralPort.TryConnect(line.TailEndPoint);
this.diagram.Model.LineRouter.RouteConnector(line);
this.diagram.Model.EndUpdate();
I have attached the sample that demonstrates this completely. You can download this sample from the following page.
http://websamples.syncfusion.com/samples/Diagram.Windows/F64108/main.htm5. If you want to hide the selection rectangle of a node then you have to derive the diagram View and override DrawHandles() method. Please refer to the following code snippet
public class MyView:Syncfusion.Windows.Forms.Diagram.View
{
public MyView()
{
}
protected override void DrawHandles(System.Drawing.Graphics grfx, NodeCollection nodesSelected)
{
if (nodesSelected != null && nodesSelected.Count > 0)
{
foreach (Node nodeCur in nodesSelected)
{
if (nodeCur.Visible)
{
HandleEditMode resultHandleEditMode = nodeCur.EditStyle.DefaultHandleEditMode;
Matrix matrixParentsTransorm = GetParentsTransform(nodeCur);
GraphicsState stateSave = grfx.Save();
grfx.MultiplyTransform(matrixParentsTransorm);
switch (resultHandleEditMode)
{
case HandleEditMode.Resize:
if (nodeCur is IEndPointContainer)
{
HandleRenderer.DrawEndPoints(grfx, nodeCur);
HandleRenderer.OutlineBoundingRectangle(grfx, nodeCur);
}
else
{
HandleRenderer.OutlineBoundingRectangle(grfx, nodeCur);
}
break;
}
}
}
}
}
I have attached the sample that demonstrates this completely. You can download the sample from the following page
http://websamples.syncfusion.com/samples/Diagram.Windows/Prevent SelectionRectangle/main.htm
Please refer to the sample and let me know if you have any questions.
Thanks,
Nagaraj