DataSetDemo is a sample to look at in terms of reading nodes and links directly from database tables.
In LayoutDemo, if you use the menu item to create a node, you can give the node a unique label…
Hi,Thanks for your reply. However, I'm using the GoDiagram Web. Does it work the same way? Can you show me an examples that take the data from the database and draw the above diagram automatically?
We have 25 Windows Forms samples, and 20 of them are also available under Web Forms as well.
Thanks. By the way, there is no function of the open file button. There is no different if i choose other file to open.
I assume you are talking about the C# version of GoDiagram Web’s LayoutDemo.
It appears we accidentally removed the OnClick attribute from the OpenButton and the SaveButton elements, in WebForm1.aspx. They need to refer to the OpenButton_Click and SaveButton_Click methods, respectively.
Sorry about that.
However, the Windows Forms version of LayoutDemo has a lot more control over the behavior of each kind of layout, since it has separate dialogs with lots of controls. Since the functionality is the same for both platforms, if you want to play with the different kinds of layout, it would be a lot easier to do so with the Windows Forms version of LayoutDemo.
Also, you’ll want to use GoLayoutLayeredDigraph, not GoLayoutTree. DataSetDemo uses GoLayoutTree since the org chart it shows is just a tree, not the more complex graph that you want to display.
Thanks for your kind help.
Hi Jake,I have some question on GoDiagram here.
It’s a binary format that we first defined for the LayoutDemo example in JGo, many years ago. I don’t recommend that you try to use it, since it is very specific to that particular sample application.
A number of the sample applications demonstrate this. Something like:
[code] // create two nodes for fun…
GoBasicNode node1 = new GoBasicNode();
// specify label, appearance, and position
node1.LabelSpot = GoObject.Middle;
node1.Text = “first”;
node1.Brush = Brushes.Blue;
node1.Location = new PointF(100, 100);
// add to the document, not to the view
GoBasicNode node2 = new GoBasicNode(); node2.LabelSpot = GoObject.Middle; node2.Text = "second"; node2.Brush = Brushes.Magenta; node2.Location = new PointF(200, 100); goView1.Document.Add(node2); // create a link between the two nodes' ports GoLink link = new GoLink(); link.ToArrow = true; link.FromPort = node1.Port; link.ToPort = node2.Port; goView1.Document.Add(link);
- If you want to change arrowhead appearance, you can set the various GoStroke properties whose names start with “ToArrow” or “FromArrow”.
Or you can reverse the link by swapping the GoLink.FromPort and .ToPort property values.
Not quite sure what you’re asking. The code Walter gave you above adds 2 nodes with a link between them. Just extend that. Or look at the code in the samples.
It’s ok. I will try to extend from the example. By the way, is there any function that storing the nodes (which are inside the goView) info. (Eg. their label).
what is the function of AddedChildName() under the GoNode? I cannot understand the meaning inside the user manual. thanks.
The DataSetDemo sample provides a demo of reading/writing a database.
The ProtoApp, FlowCharter, OrgCharter, StateCharter, and Processor samples read/write XML, some in more than one format.
Any examples on AddChildName ()?
Demo1 and OrgCharter both use AddChildName.
re: How do i check whether a node with text “ABC” is plotted inside the GoView