Click here to Skip to main content
15,886,745 members
Home / Discussions / C#
   

C#

 
GeneralRe: UserControl Problem w/Exposing Property Pin
MarkMokris30-Jan-06 6:01
MarkMokris30-Jan-06 6:01 
GeneralRe: UserControl Problem w/Exposing Property Pin
kasik30-Jan-06 6:08
kasik30-Jan-06 6:08 
Question.Net Framework Pin
Net-Programer-and-developer30-Jan-06 4:10
Net-Programer-and-developer30-Jan-06 4:10 
AnswerRe: .Net Framework Pin
User 665830-Jan-06 4:43
User 665830-Jan-06 4:43 
AnswerRe: .Net Framework Pin
Dave Kreskowiak30-Jan-06 13:54
mveDave Kreskowiak30-Jan-06 13:54 
QuestionSerialization of ListDictionary Pin
zeo3330-Jan-06 3:49
zeo3330-Jan-06 3:49 
QuestionWindows forms and Test dialog in C# Pin
talbot30-Jan-06 3:37
talbot30-Jan-06 3:37 
Questionparent and child nodes Pin
dhol30-Jan-06 2:30
dhol30-Jan-06 2:30 
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 = txtSALARY.Text;
int intSALARY;
if (!strSALARY.Equals(string.Empty)) // check to make sure the user entered something
intSALARY = Convert.ToInt32(strSALARY);

//create a new row
DataRow newrow;
newrow = dataSet.Tables[0].NewRow();

// add new row.
newrow["ParentNAME"] = strParentNAME;
newrow["AGE"] = strAGE;
newrow["SALARY"] = strSALARY;

AddNode(strParentNAME,strAGE,strSALARY);

//add the row to the dataset
dataSet.Tables[0].Rows.Add(newrow);
//write the data to a xml file
dataSet.WriteXml("..\\..\\resultdata.xml", XmlWriteMode.WriteSchema);

dataSet.AcceptChanges();
MessageBox.Show("Saved");
}



//form load
private void Form1_Load(object sender, System.EventArgs e)
{
DataSet dataSet = new DataSet();
//read the schema
dataSet.ReadXmlSchema("..\\..\\Menu.xsd");
dataSet.WriteXml("..\\..\\resultdata.xml",XmlWriteMode.WriteSchema);



}


please help me to do this
Questionicons for binayr files Pin
relsirc30-Jan-06 1:46
relsirc30-Jan-06 1:46 
QuestionInterfaces? Pin
FruitBatInShades30-Jan-06 1:26
FruitBatInShades30-Jan-06 1:26 
AnswerRe: Interfaces? Pin
Guffa30-Jan-06 2:25
Guffa30-Jan-06 2:25 
AnswerRe: Interfaces? Pin
User 665830-Jan-06 4:39
User 665830-Jan-06 4:39 
QuestionAnyone used/worked with iTextSharp off sourceforge.net Pin
NewbieDude30-Jan-06 1:15
NewbieDude30-Jan-06 1:15 
AnswerRe: Anyone used/worked with iTextSharp off sourceforge.net Pin
Ravi Bhavnani30-Jan-06 8:07
professionalRavi Bhavnani30-Jan-06 8:07 
QuestionDataGrid + array Pin
ita_cas30-Jan-06 1:00
ita_cas30-Jan-06 1:00 
QuestionHow to get SqlTypes of a particular column in sqlserver using C# Pin
YogeshChoudhary30-Jan-06 0:58
YogeshChoudhary30-Jan-06 0:58 
QuestionC# or VB? Pin
cybernd30-Jan-06 0:51
cybernd30-Jan-06 0:51 
AnswerRe: C# or VB? Pin
NewbieDude30-Jan-06 1:17
NewbieDude30-Jan-06 1:17 
GeneralRe: C# or VB? Pin
Dave Kreskowiak30-Jan-06 1:39
mveDave Kreskowiak30-Jan-06 1:39 
GeneralRe: C# or VB? Pin
cybernd30-Jan-06 2:31
cybernd30-Jan-06 2:31 
AnswerRe: C# or VB? Pin
Guffa30-Jan-06 2:54
Guffa30-Jan-06 2:54 
Questionopen xmlReader with internet explorer c# Pin
fady_sayegh30-Jan-06 0:18
fady_sayegh30-Jan-06 0:18 
AnswerRe: open xmlReader with internet explorer c# Pin
Douglas Troy30-Jan-06 5:34
Douglas Troy30-Jan-06 5:34 
QuestionIE Web Controls Pin
karthik_dotnet129-Jan-06 23:21
karthik_dotnet129-Jan-06 23:21 
QuestionSQL Server 2005 Pin
AB777129-Jan-06 23:18
AB777129-Jan-06 23:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.