Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic how to idnetify node location (Read 1536 times)
bhanuprakash007
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 23
Joined: Sep 29th, 2009
how to idnetify node location
Oct 13th, 2009 at 7:01am
Print Post  
Hi  I am using net diagramming for webapplications.

i am using flowcharter sample project.i want to dispaly text on node from databse using sql.

How can i bind data to node.and how can i know node position whne retriving data from database.

Each time  i am getting a id when a node creted..can you exaplin this with a sample code

here  i am attaching my code to get uniqueid

Code
Select All
function getUniqueId()
{

			     var dateObject = new Date();

			     var uniqueId = dateObject.getFullYear() + "" + dateObject.getMonth() + "" +

			     dateObject.getDate() + "" +

			     dateObject.getTime();

			     document.getElementById("tbnid").value=uniqueId;

}
 



i am saving this value into database 
now server side i am using this code
Code
Select All
 protected void Page_Load(object sender, EventArgs e)
    {
	  if (!IsPostBack)
	  {
		Diagram diagram = diagramView.Diagram;

		diagram.SelectAfterCreate = false;

		//diagram.BackBrush = new MindFusion.Drawing.SolidBrush(Color.LightGray);

		ShapeNode start = diagram.Factory.CreateShapeNode(10, 10, 20, 15);
		//diagram.ShapeBrush = new MindFusion.Drawing.LinearGradientBrush(Color.ForestGreen, Color.White, 30);

		//Session("uid") = Request.QueryString("tbnid");
		//tbnid = Request.QueryString("tbnid.value");
		string connstr1 = "Data Source=192.168.2.18;Initial Catalog=ERP_SCM_Dev;User ID=sa;Password=eljefe";
		SqlConnection con1 = new SqlConnection(connstr1);
		string query1 = "select NestedID , Status,uniqueidfrom vwNestedorderDetails where OrderID ='15'";
		SqlCommand cmd1 = new SqlCommand(query1, con1);
		SqlDataAdapter da = new SqlDataAdapter(query1, con1);
		DataSet ds = new DataSet();
		da.Fill(ds, "data");

		for (i = 0; i <= ds.Tables["data"].Rows.Count - 1; i++)
		{
		    {
			  if (tbnid.Text == ds.Tables["data"].Rows[i]["uniqueid"])

			   id = ds.Tables["data"].Rows[i]["diagramid"].ToString();
				ShapeNode node1 = diagram.FindNode(id) as ShapeNode;

				nodename = ds.Tables["data"].Rows[i]["NestedID"].ToString() + "-" + ds.Tables["data"].Rows[i]["Status"].ToString();
				if ( node1 != null)
			     {
				   node1.Text = nodename;
			    }


		    }

		}
	  }
    }

 



here from this sql i am getting 3 uniqued ids .so how can i bind data to eachnode with its unique id..how can i konw loacation of a node ..any suggetions orsample code willl be appricate
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: how to idnetify node location
Reply #1 - Oct 13th, 2009 at 8:06am
Print Post  
This statement in the loop looks wrong:

if (tbnid.Text == ds.Tables["data"].Rows[i]["uniqueid"])
     id = ds.Tables["data"].Rows[i]["diagramid"].ToString();

As a result, id either stays uninitialized, or it always has the same value.

You can get the location of a node using the node.Bounds property.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint