Click here to Skip to main content
15,897,187 members
Home / Discussions / C#
   

C#

 
Questionhow do i delete the selected node programmatically in tree view? Pin
samidhas22-Jan-08 21:06
samidhas22-Jan-08 21:06 
AnswerRe: how do i delete the selected node programmatically in tree view? Pin
michaelvdnest22-Jan-08 21:39
michaelvdnest22-Jan-08 21:39 
GeneralRestor DataBase By C#.Net Code Pin
Thaer Hamael22-Jan-08 20:48
Thaer Hamael22-Jan-08 20:48 
AnswerRe: Restor DataBase By C#.Net Code Pin
Abhijit Jana22-Jan-08 22:06
professionalAbhijit Jana22-Jan-08 22:06 
GeneralRe: Restor DataBase By C#.Net Code Pin
Thaer Hamael26-Jan-08 21:08
Thaer Hamael26-Jan-08 21:08 
GeneralPassing session variables in to javascript in asp.net Pin
mrcsn22-Jan-08 19:56
mrcsn22-Jan-08 19:56 
NewsRe: Passing session variables in to javascript in asp.net Pin
Abhijit Jana22-Jan-08 20:48
professionalAbhijit Jana22-Jan-08 20:48 
Generalaccessing , deleting , modifing xml file using tree view in c# .net.. Pin
samidhas22-Jan-08 19:55
samidhas22-Jan-08 19:55 
hi i want to add , delete an modify axml file directly from tree view
i have done some code to access it , but i am not getting how to add an modify n delete a node directy
.

code:
private void Form1_Load(object sender, System.EventArgs e)
{
// Initialize the controls and the form.
label1.Text = "File Path";
label1.SetBounds(8, 8, 50, 20);
textBox1.Text = Application.StartupPath + "\\Sample.xml";
textBox1.SetBounds(64, 8, 256, 20);
button1.Text = "Populate the TreeView with XML";
button1.SetBounds(8, 40, 200, 20);
this.Text = "TreeView control from XML";
this.Width = 336;
this.Height = 368;
treeView1.SetBounds(8, 72, 312, 264);

}

private void button1_Click(object sender, System.EventArgs e)
{
try
{
// SECTION 1. Create a DOM Document and load the XML data into it.
XmlDocument dom = new XmlDocument();
dom.Load(textBox1.Text);

// SECTION 2. Initialize the TreeView control.
treeView1.Nodes.Clear();
treeView1.Nodes.Add(new TreeNode(dom.DocumentElement.Name));
TreeNode tNode = new TreeNode();
tNode = treeView1.Nodes[0];

// SECTION 3. Populate the TreeView with the DOM nodes.
AddNode(dom.DocumentElement, tNode);
treeView1.ExpandAll();
}
catch(XmlException xmlEx)
{
MessageBox.Show(xmlEx.Message);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}

}
private void AddNode(XmlNode inXmlNode, TreeNode inTreeNode)
{
XmlNode xNode;
TreeNode tNode;
XmlNodeList nodeList;
int i;

// Loop through the XML nodes until the leaf is reached.
// Add the nodes to the TreeView during the looping process.
if (inXmlNode.HasChildNodes)
{
nodeList = inXmlNode.ChildNodes;
for(i = 0; i<=nodeList.Count - 1; i++)
{
xNode = inXmlNode.ChildNodes[i];
inTreeNode.Nodes.Add(new TreeNode(xNode.Name));
tNode = inTreeNode.Nodes[i];
AddNode(xNode, tNode);
}
}
else
{
// Here you need to pull the data from the XmlNode based on the
// type of node, whether attribute values are required, and so forth.
inTreeNode.Text = (inXmlNode.OuterXml).Trim();
}

}




plz help me . or send me an pprom on manasvi.s.s@gmail.com
GeneralRe: accessing , deleting , modifing xml file using tree view in c# .net.. Pin
Paul Conrad27-Jan-08 7:20
professionalPaul Conrad27-Jan-08 7:20 
Generalcluless what is happening Pin
Hum Dum22-Jan-08 19:54
Hum Dum22-Jan-08 19:54 
GeneralRe: cluless what is happening Pin
michaelvdnest22-Jan-08 22:04
michaelvdnest22-Jan-08 22:04 
GeneralHelp regarding Hash table in C#.Net Pin
mrcsn22-Jan-08 19:38
mrcsn22-Jan-08 19:38 
GeneralRe: Help regarding Hash table in C#.Net Pin
Mark Churchill23-Jan-08 0:06
Mark Churchill23-Jan-08 0:06 
QuestionDelete .wav file from linux server using c#.net Pin
patel_amit22-Jan-08 19:22
patel_amit22-Jan-08 19:22 
GeneralRe: Delete .wav file from linux server using c#.net Pin
leppie22-Jan-08 21:20
leppie22-Jan-08 21:20 
GeneralRe: Delete .wav file from linux server using c#.net Pin
patel_amit22-Jan-08 23:08
patel_amit22-Jan-08 23:08 
GeneralRe: Delete .wav file from linux server using c#.net Pin
Russell Jones23-Jan-08 3:20
Russell Jones23-Jan-08 3:20 
GeneralAnswer for this Questions Pin
gunaarun22-Jan-08 18:44
gunaarun22-Jan-08 18:44 
JokeRe: Answer for this Questions Pin
MarkB77722-Jan-08 20:28
MarkB77722-Jan-08 20:28 
GeneralRe: Answer for this Questions Pin
Nouman Bhatti22-Jan-08 20:45
Nouman Bhatti22-Jan-08 20:45 
AnswerRe: Answer for this Questions Pin
Abhijit Jana22-Jan-08 20:46
professionalAbhijit Jana22-Jan-08 20:46 
GeneralRe: Answer for this Questions Pin
Guffa22-Jan-08 21:21
Guffa22-Jan-08 21:21 
GeneralRe: Answer for this Questions Pin
darkelv23-Jan-08 0:56
darkelv23-Jan-08 0:56 
QuestionRegarding report generation Pin
tasumisra22-Jan-08 18:20
tasumisra22-Jan-08 18:20 
GeneralC# Airbrush Pin
electriac22-Jan-08 14:14
electriac22-Jan-08 14:14 

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.