Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ListBox from xml exported file (Read 2176 times)
svendazjer
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Oct 8th, 2010
ListBox from xml exported file
Oct 8th, 2010 at 4:31pm
Print Post  
Hi, I'm tryng to load an xml file exported from the flowcharterto the listbox, but when I loaded into the listbox list the right number of items but not the right properties of them, such as shape or text values...

if anyone can help I would really appreciate.

thanks in advance.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ListBox from xml exported file
Reply #1 - Oct 8th, 2010 at 6:25pm
Print Post  
Hi,

How exactly are you loading a diagram file into a listbox?

Stoyan
  
Back to top
 
IP Logged
 
svendazjer
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Oct 8th, 2010
Re: ListBox from xml exported file
Reply #2 - Oct 8th, 2010 at 6:57pm
Print Post  
I'm tryng opening the file with the LoadFromXml function, like this diagram.LoadFromXml(_openFileDialog.FileName);

then I try to to get the nodes from the diagram,

DiagramNodeCollection mynodecollection = diagram.Nodes;

and then I use  a foreach structor to proccess each node and put it into the listbox, like this

foreach (DiagramNode mynode in mynodecollection)
{
       _nodeList.Items.Add(mynode);
}

But didn't work.

I also try to open the file as an XmlDocument, and put each node into thge listbox as and XmlNode, somthing like:

XmlDocument myxmldocument=new XmlDocument();
myxmldocument.Load("Sample.xml");
XmlNode mynodes=(XmlNode)myxmldocument.DocumentElement;

foreach (XmlNode mynode in mynodes["Nodes"])
{
       _nodeList.Items.Add(mynode);
}

But didn't work.

This is the Xml file that I'm using: http://tinyurl.com/2exb9sh

Also I'm using C# and Visual Studio 2008
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ListBox from xml exported file
Reply #3 - Oct 8th, 2010 at 8:15pm
Print Post  
Is _nodeList a ListBox or ShapeListBox? If you need to display node shapes inside a ListBox, check how they are custom-drawn in the Flowcharter sample project. If it's a ShapeListBox, you can add Shape objects to it (e.g.  mynode.Shape).

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint