Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Data binding (Read 6037 times)
Aleksey
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 1
Joined: Feb 12th, 2007
Data binding
Feb 12th, 2007 at 11:36am
Print Post  
Hi. We need to create orgDiagramm view from our existing structure(tree) wich stored in MS SQL databae. Is there possibility to bind data and autocreate a diagramm?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3440
Joined: Oct 19th, 2005
Re: Data binding
Reply #1 - Feb 12th, 2007 at 11:58am
Print Post  
Hi,

There's no databinding support implemented right now. You can implement that yourself like this:

- iterate the dataset for the nodes table and create a box for each node using CreateBox; save in a hash table the mapping between the node ID and the Box object

- iterate the links table and create the links between boxes using CreateArrow; use the hash table to find the boxes that you should use as CreateArrow parameters from the nodes IDs

- create a TreeLayout object and call its Arrange method

HTH

p.s. We have a general purpose binding module implemented in our Planner.NET component and we can easily reuse that in NetDiagram, but we will leave that for version 1.1
  
Back to top
 
IP Logged
 
macleon
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: Jun 20th, 2007
Re: Data binding
Reply #2 - Jun 20th, 2007 at 6:22pm
Print Post  
Dear Sir,

I also having problem generate tree diagram from database(mysql) as it is not yet supported databinding. As for that can u give more details or sample on how to create diagram tree with load data etc.

thanks.

p/s: im using vs c sharp 2005
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Data binding
Reply #3 - Jun 21st, 2007 at 5:39am
Print Post  
Hi,

You could build a tree diagram from database records as shown below:

[code]
Hashtable childToParent = new Hashtable();

SqlCommand cmd = new SqlCommand();
cmd.Connection = conn1;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "SELECT * FROM dbo.TreeNodes";
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
     Box node = fc.CreateBox(0, 0, 40, 30);

     int nodeID = reader.GetInt32(0);
     node.Text = reader.GetString(1);
     int parentID = reader.GetInt32(2);

     node.Tag = nodeID;
     childToParent[nodeID] = parentID;
}

foreach (Box b in fc.Boxes)
{
     if  (!childToParent.ContainsKey(b.Tag))
           continue;

     fc.CreateArrow(
           fc.FindBox(childToParent[b.Tag]), b);
}

TreeLayout tl = new TreeLayout();
tl.Arrange(fc);

[/code]

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
logikonline
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 1
Joined: Nov 29th, 2007
Re: Data binding
Reply #4 - Nov 29th, 2007 at 10:15pm
Print Post  
Love the control.. but for an orgchart I would suggest using this one.

http://xmlforasp.net/applications/orgchart.net/OrgChartBuilder.aspx

Although, I wish you guys would make this functionality in yours.

D
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Data binding
Reply #5 - Nov 30th, 2007 at 5:33am
Print Post  
Isn't this what you get with the Netdiagram's ImageMap mode and a TreeLayout?
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint