Problems in dataset demo like application

Hi to all,

I am using dataset demo of GoDiagram to develop a tree like structure.
I have make it database driven tree.In this the parent and child comes from database.
Although I have implemented to add a new node,update node properties and delete the nodes.
But our some requirements are not fullfilling by this product or may be I am unsuccess to make it possible.
I am listing here our problems as I am facing recently.I would appreciate if forum members help me to find out solutions of these listed issues.
1) In our diagram we are making it possible to relink the nodes but problem here is to update the database after rearrangement of nodes.I am unable to update database after rearrangement of nodes.
2)We are unable to find out the ID of that particular node on mouse right click on this.
Waiting for your response.
Thanks on advance.
  1. DataSetDemo does this already. Look at the GoView.LinkRelinked event handler.
2) You can either implement a GoView.ObjectContextClicked event handler, similar to the GoView.ObjectDoubleClicked event handler, or you could override GoObject.OnContextClick in your node class.
In the GoView event handler, the context click might not happen on the kind of object you care about -- so you should look at the e.GoObject.ParentNode to see if it is an instance of your node class.
In the GoObject event handler, if you defined it in your node class, then obviously "this" is the node that you care about.

Hi walter,

Thanks for your response.
We are using our code in suggested event by you.But unable to find desired result.
Can you please give some lines of code for these events with help of database driven way,so it will be easy to understand it.
I will be thankful for this.
private void goView1_ObjectContextClicked(Object sender, GoObjectEventArgs e) {<BR>  PersonNode n = e.GoObject.ParentNode as PersonNode;<BR>  if (n == null) return null;<BR>  ... use n.ID ...<BR>}

Hi walter,

Thanks for your response.
But after adding or deleting the node from godiagram it does not refresh it automatically.we have to close application and again run it to see the effect of previous operation.
can you have any solution for autorefresh the goview.

Are you programmatically adding a node to the GoDiagram document, or are you adding a row to a table?

I am adding new nodes programmatically.although it added new node in database but doesnot show response quickly.

To see the changes in goview we again execute this,then it shows changes.
our requirement here is that after adding new node in this(for adding new node we have give a form to user for node info.),the page should automatic refresh so that it shows changes in goview.

If there is both a new node and a new link (connecting that new node to another node) in the GoDocument, and if there is a corresponding row in your table, you can just call AutoLayout() to do another tree layout.

Hi to all

I am using datasetdemo like application.
In which I want when user select one node and drop on another node then it relink the node as per user request.
can you please give a sample of code to fulfill this requirement.

OrgCharter and Flowgrammer implements that behavior in slightly different ways.

I suggest you do what Flowgrammer does: implement either a GoView.ObjectSelectionDropped event or a GoObject.OnSelectionDropped override on your node class.

These event (GoView.ObjectSelectionDropped event and GoObject.OnSelectionDropped) are not fulfilling our requirements.

I basically want to pick the id of pick node(e.g. NODE A) and id of drop node(e.g. NODE B),to which NODE A is dropped and as a result NODE A will become child of NODE B.

Sorry, I meant the Planogrammer sample, as an example of using the “SelectionDropped” event, not Flowgrammer. Although the Flowgrammer sample does do what you want – automatically linking up the dropped node – but it does so for something dragged from a TreeView, not from a GoView.

I think overriding GoObject.OnSelectionDropped is exactly what you want. The dropped node(s) will already be part of the GoDocument. You just need to create link(s) to connect "this" node with each of the dropped node(s). Afterwards, perform a layout to position all of the new node(s) appropriately.
If you are handling drops from another GoView, such as a GoPalette, you will want to set GoView.ExternalDragDropsOnEnter to true.

Hi walter,

I am not getting an event like GoView_OnSelectionDropped.
can you please specify it event for goview to achieve our requirements.
I am using datasetdemo like application.