Click here to Skip to main content
15,903,175 members
Home / Discussions / C#
   

C#

 
AnswerRe: Please advice control which maps two lists Pin
TJoe5-Feb-08 3:19
TJoe5-Feb-08 3:19 
GeneralRe: Please advice control which maps two lists Pin
vgrigor15-Feb-08 4:42
vgrigor15-Feb-08 4:42 
GeneralRe: Please advice control which maps two lists Pin
TJoe5-Feb-08 5:02
TJoe5-Feb-08 5:02 
GeneralRe: Please advice control which maps two lists Pin
vgrigor16-Feb-08 22:36
vgrigor16-Feb-08 22:36 
QuestionCode for Displaying Word document in my aspx page. Pin
Bhavesh Patel5-Feb-08 2:44
Bhavesh Patel5-Feb-08 2:44 
GeneralRe: Code for Displaying Word document in my aspx page. Pin
Not Active5-Feb-08 3:30
mentorNot Active5-Feb-08 3:30 
Generalinstall Pin
arkiboys5-Feb-08 2:08
arkiboys5-Feb-08 2:08 
AnswerRe: install Pin
TJoe5-Feb-08 2:12
TJoe5-Feb-08 2:12 
GeneralRe: install Pin
arkiboys5-Feb-08 2:36
arkiboys5-Feb-08 2:36 
Generalapp config file for the windows services Pin
M. J. Jaya Chitra5-Feb-08 2:06
M. J. Jaya Chitra5-Feb-08 2:06 
QuestionRe: app config file for the windows services Pin
TJoe5-Feb-08 4:22
TJoe5-Feb-08 4:22 
Questionwhich is best option? Pin
Try5-Feb-08 1:02
Try5-Feb-08 1:02 
AnswerRe: which is best option? Pin
Malcolm Smart5-Feb-08 1:42
Malcolm Smart5-Feb-08 1:42 
GeneralRe: which is best option? Pin
Try5-Feb-08 2:00
Try5-Feb-08 2:00 
AnswerRe: which is best option? Pin
Guffa5-Feb-08 2:10
Guffa5-Feb-08 2:10 
GeneralUser login or not to a system Pin
CodingLover5-Feb-08 0:09
CodingLover5-Feb-08 0:09 
GeneralRe: User login or not to a system Pin
Malcolm Smart5-Feb-08 1:48
Malcolm Smart5-Feb-08 1:48 
GeneralRe: User login or not to a system Pin
CodingLover6-Feb-08 0:04
CodingLover6-Feb-08 0:04 
GeneralRe: User login or not to a system Pin
Not Active5-Feb-08 3:37
mentorNot Active5-Feb-08 3:37 
GeneralRe: User login or not to a system Pin
CodingLover6-Feb-08 0:08
CodingLover6-Feb-08 0:08 
GeneralClose Window problem [modified] Pin
Neo Andreson4-Feb-08 23:04
Neo Andreson4-Feb-08 23:04 
GeneralRe: Close Window problem Pin
TJoe5-Feb-08 2:14
TJoe5-Feb-08 2:14 
GeneralRe: Close Window problem Pin
Neo Andreson5-Feb-08 18:22
Neo Andreson5-Feb-08 18:22 
GeneralRe: Close Window problem Pin
TJoe6-Feb-08 2:17
TJoe6-Feb-08 2:17 
Questionhow to add a now treenode in the following code? Pin
samidhas4-Feb-08 22:53
samidhas4-Feb-08 22:53 
if i want to insert a now node name an value , by entering it in the text box, and after cliking on button the node should be add to the tree view
--------------------------------------------------------------------
private void Form1_Load(object sender, System.EventArgs e)
{

button1.Text = "Populate the TreeView with XML";
button1.SetBounds(8, 20, 200, 20);
treeXml.Height = 600;
treeXml.Width = 400;
grpbox = new GroupBox();
grpbox.Height = 600;
grpbox.Width = 400;
grpbox.SetBounds(500, 2, 700, 600);
grpbox.Visible = true;
grpbox.Dock.Equals(Right);
grpbox.Show();
this.Controls.Add(grpbox);


}

private void ConvertXmlNodeToTreeNode(XmlNode xmlNode,
TreeNodeCollection treeNodes)
{

TreeNode newTreeNode = treeNodes.Add(xmlNode.Name);

switch (xmlNode.NodeType)
{
case XmlNodeType.ProcessingInstruction:
case XmlNodeType.XmlDeclaration:
newTreeNode.Text = "<?" + xmlNode.Name + " " +
xmlNode.Value + "?>";
break;
case XmlNodeType.Element:
if (xmlNode.Name.ToLower().Equals("node") == true)
{
newTreeNode.Text = "<" + xmlNode.Attributes["label"].Value.ToString() + ">";
}
else
newTreeNode.Text = "<" + xmlNode.Name + ">";
break;
case XmlNodeType.Attribute:

newTreeNode.Text = xmlNode.Name;

// newTreeNode.Text = "ATTRIBUTE: " + xmlNode.Name;
break;
case XmlNodeType.Text:
case XmlNodeType.CDATA:
newTreeNode.Text = xmlNode.Value;
break;
case XmlNodeType.Comment:
newTreeNode.Text = "<!--" + xmlNode.Value + "-->";
break;
}

if (xmlNode.Attributes != null)
{
foreach (XmlAttribute attribute in xmlNode.Attributes)
{
ConvertXmlNodeToTreeNode(attribute, newTreeNode.Nodes);
}
}
foreach (XmlNode childNode in xmlNode.ChildNodes)
{
ConvertXmlNodeToTreeNode(childNode, newTreeNode.Nodes);
}
}
--------------------------------------------------------------------------

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.