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
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
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