Node Click Event

Hi,
I am using diagram components for ASP.net WebForms and pallete window.
1)How we save diagram in XML file and load?
2)How to find click event of node? And how to get node Id for selected node?
3)How we create new property for node?

Hi,

For read xml file I have write following code.

GoXmlReader xr = new GoXmlReader();
RegisterTransformers(xr);
using (StreamReader file = new StreamReader(path))
{
MyView.Document = (GoDocument)xr.Consume(file);
}
But its showing following error,
Unable to cast object of type ‘System.Collections.Generic.List`1[System.Object]’ to type ‘Northwoods.GoWeb.GoDocument’.

1)How we save diagram in XML file and load?

GoXml is a part of GoDiagram, helping you save and restore diagrams to XML, and it looks
like from your second post you’ve discovered it. But I’d have to see your RegisterTransformers
and XML to help more.

2)How to find click event of node? And how to get node Id for selected node?

GoView has an ObjectSingleClicked event. Samples like DataSetDemo show it in use.

3)How we create new property for node?

By deriving your own node class from one of ours and adding a property. There are some rules on
copying and serialization though… look at our samples.

And… the User Guide is a good place to start. A quick read through will answer a lot of these questions for you.

Hi Jake,

I have problem in read xml file and load xml file in view.

Code:-

GoXmlReader xr = new GoXmlReader();
RegisterTransformers(xr);
using (StreamReader file = new StreamReader(path))
{
MyView.Document = (GoDocument)xr.Consume(file);
}
This code is not working its show exception. Exception happen when I read xml file and show in view.
Exception:-

Unable to cast object of type ‘System.Collections.Generic.List`1[System.Object]’ to type ‘Northwoods.GoWeb.GoDocument’.

The xml file you sent me in email works in an unmodified version of flowcharter, so
I guess the thing to do is look at changes you’ve made. I’m guessing in the
code to RegisterTransformers, but since you didn’t supply that, I can’t say for sure.

OK… here’s the code from Flowcharter…

  GoXmlReader xr = new GoXmlReader();
  InitReaderWriter(xr);
  GraphDoc doc = xr.Consume(file) as GraphDoc;

so I’m not sure what you’ve done. We do have 4 samples with a “RegisterTransformers” method,
but flowcharter doesn’t.