We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Several diagram questions and issues (evaluating)

Thread ID:

Created:

Updated:

Platform:

Replies:

97405 Nov 24,2010 05:50 AM Nov 26,2010 01:06 PM Windows Forms 1
loading
Tags: Diagram
Martijn Loeffen
Asked On November 24, 2010 05:50 AM

Last few days I started evaluating the Essential Diagram and encountered issues and questions which I hope someone can help me solve. A vs2010 c# project illustrating some of the issues is attached to this post.

Scenario
In our app there are multiple forms where the diagram control should visualize object-relations. Currently these are solely for displaying purposes. I created a derived (custom) diagram-usercontrol for this purpose.

Questions
- how do I clear all the nodes, so I can recreate other object-relations on the same control?
- is there some sort of SimpleView property, where the Models size takes takes the size it needs, and scrollbars are painted when the Nodes are displayed beyond the border of the diagram control. If it's not a single property, any code that will come close to this is appreciated.
- how can I get the default behavior of the mouse to make it move the model in the diagramcontrol, instead of using the selection tool.
- can I redraw the selected node with a different color to make it more interactive?
- Is it possible to make the background of the diagram and model transparent?

possible bugs:
1) when setting EditStyle.AllowSelect = false, it still selects a node (the last one added?). If I click the node, the selection disappears.
2) the border of the model is still painted when I set its width to 0 (diagram1.Model.LineStyle.Width)
3) when you set HScroll and VScroll to true and the model is smaller than the diagramcontrol, it doesn't take the scrollbars dimensions into account, allowing to scroll the model when there's nothing to scroll.



MyDiagramUserControl_a3496ec2.zip

Jaffersathick B [Syncfusion]
Replied On November 26, 2010 01:06 PM


Hi Mloeffen,

Thank you for your interest in Syncfusion Essential Studio’s Diagram control. I will try to respond to each on your questions inline. Please let me know if I have missed anything in my response.


Questions:

1. How do I clear all the nodes, so I can recreate other object-relations on the same control?

Diagram control's model has a method called Clear () which can be used to clear objects in the diagram model. We suggest you to clear nodes in the diagram.
Please refer the below code snippet to achieve this:

[C#]
public void ClearGraphObjects()
{
this.Model.Clear();
}


2. Is there some sort of SimpleView property, where the Models size takes takes the size it needs, and scrollbars are painted when the Nodes are displayed
beyond the border of the diagram control. If it's not a single property, any code that will come close to this is appreciated.

Diagram control has some specific properties called 'SizeToContent' and 'BoundaryConstraintsEnabled' which are used for auto resizing the model size when nodes go out
of bounds on model. We suggest you set SizeToContent as true and BoundaryContraintsEnable as false. Please refer to the below code snippet to achieve this:

[C#]
this.diagram1.Model.BoundaryConstraintsEnabled = false;
this.diagram1.Model.SizeToContent = true;


3. How can I get the default behavior of the mouse to make it move the model in the diagram control, instead of using the selection tool?

In diagram control the selection tool is activated by default. If your intension is to disable the selection tool, we suggest you to cancel the SelectTool’s
action, please use the below code to achieve this,

[C#]
void diagram1_MouseDown(object sender, MouseEventArgs e)
{

Tool t = diagram1.Controller.ActiveTool;
if (t is SelectTool)
{
t.Abort();
diagram1.Controller.SelectionList.Clear();
}
}

If this is not your actual requirement, please let me know by giving me more specific information so that I can provide a better solution for your needs.

4. Can I redraw the selected node with a different color to make it more interactive?

Yes, you can change the background color of the node by using FillStyle property when the node is selected. Please refer to the below code snippet to achieve this:

[C#]

foreach (Node node in myDiagramControl1.Model.Nodes)
{
node.EditStyle.AllowSelect = true;
}

foreach (Node node in diagram1.Controller.SelectionList)
{
((Syncfusion.Windows.Forms.Diagram.RoundRect)node).FillStyle.Color = Color.Yellow;
}


5.Is it possible to make the background of the diagram and model transparent?

Yes, it is possible to set the diagram model to be transparent and we can also change the background color of the diagram. For changing the background color of the diagram model to transparent, the diagram model has a property called BackgroundStyle, we suggest you to use this to change diagram model’s Background. .Please refer the below code snippet.

[C#]
this.diagram1.View.Grid.Visible = false;
this.diagram1.Model.BackgroundStyle.Color = Color.Transparent;


We have modified your sample to demonstrate all these requirements and the same can be downloaded from the below link.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=Diagrams556903719.zip

Please let us know if we can be of further assistance.


However it is not possible to set the Diagram itself to be transparent. We think this could be a defect and we have forwarded this to our Development Team for further analysis. We will update you with our Development Team’s response in two business days.


Other Possible Bugs:

Please let me know with further information if I have missed your requirement in addressing each of these issues.

1) When setting EditStyle.AllowSelect = false, it still selects a node (the last one added?). If I click the node, the selection disappears.

The issue reported by you is suspected to be a defect. We have forwarded this to our Development Team for further analysis. We will update you with our Development Team’s response in two business days.

if you set allowselect is false, you cannot select a node in order to change its background color at runtime. Could you please let us know your actual requirements.

2) The border of the model is still painted when I set its width to 0 (diagram1.Model.LineStyle.Width)

The issue 'the border of the model is still painted when I set its width to 0' reported by you is suspected to be a defect. We have forwarded this to our
Development Team for further analysis. We will update you with our Development Team’s response on Monday.

As a workaround we can set the line color as transparent, please refer to the below code snippet to achieve this.

[C#]
this.diagram1.Model.LineStyle.LineColor=Color.Transparent;

3) When you set HScroll and VScroll to true and the model is smaller than the Diagramcontrol, it doesn't take the scrollbars dimensions into account,
allowing to scroll the model when there's nothing to scroll.

The issue 'when you set HScroll and VScroll to true and the model is smaller than the Diagramcontrol, it doesn't take the scrollbars dimensions into account,
allowing to scroll the model when there's nothing to scroll' reported by you is suspected to be a defect. We have forwarded this to our Development Team for
further analysis. We will update you with our Development Team’s response in two business days.

These bug fixes will be addressed in the Support incident 74609 - the incident we have created for you in your Direct Trac account, because per policy, we cannot provide defect fixes in the public forum.


Regards,
Bala Murugan A.S



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;