Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. parent and child nodes

parent and child nodes

Scheduled Pinned Locked Moved C#
xmltutorialcsharpdatabasedata-structures
1 Posts 1 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dhol
    wrote on last edited by
    #1

    Hi i am working in c# with infragistics In c# windows applicaion, I will be passing data from textbox..such that for example:i havE 3 texboxes labeled name: age: salary:.... Now name is the parent and age and salary r the child..so if i pass data in the appropriate textbox..It should be added in the ultrawintree.......such that name(parent) should show up on the root node of the tree. and age and salary(child) should show up under the root node. so now when I run this program, as it reads a xml schema and creates a xml file.. now when I clicked the ADD button, it checks for the xml file and each textbox is binded to the xml elements..so that the data which is passed in the xml file willbe added in the xml.. now for example i gave john,22,1800 for name,age and salary respectively and again john,45,3800 so it should be shown in teh tree as follows tht john under john both ages and salary should be shown ie like parent(name) : john child(age) : 22 45 child(salary): 1800 3800 but i am getting teh result as follows.. john 22 1800 and again john 45 3800 seperately.... so please tell me how to do it. here is my coding part //FUNCTION FOR ADDINGNODES private void AddNode(string ParentNAME, string AGE, string SALARY) { //add parent node Infragistics.Win.UltraWinTree.UltraTreeNode parentNAMEnode = new Infragistics.Win.UltraWinTree.UltraTreeNode(); Infragistics.Win.UltraWinTree.UltraTreeNode AGEnode = new Infragistics.Win.UltraWinTree.UltraTreeNode(); Infragistics.Win.UltraWinTree.UltraTreeNode SALARYnode = new Infragistics.Win.UltraWinTree.UltraTreeNode(); //add parent node parentNAME.Text = ParentNAME; //other nodes AGEnode.Text = AGE; SALARYnode.Text = SALARY; //add childnodes to parent parentNAMEnode.Nodes.Add(AGEnode); parentNAMEnode.Nodes.Add(SALARYnode); parentNAMEnode.Expanded = true; //add teh nodes to teh ultratree ultraTree1.Nodes.Add(parentNAMEnode); } //ADD button private void button1_Click(object sender, System.EventArgs e) { DataSet dataSet = new DataSet(); // Read the existing xml dataSet.ReadXml("..\\..\\resultdata.xml"); //PARENTName TEXTBOX string strParentNAME = txtParentNAME.Text; //AGE Text box----int type string strAGE = txtAGE.Text; int intAGE; if (!strAGE.Equals(string.Empty)) // check to make sure the user entered something intAGE = Convert.ToInt32(strAGE); //SALARY Text box----int type string strSALARY =

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups