Click here to Skip to main content
15,902,112 members
Home / Discussions / C#
   

C#

 
QuestionString representation of an object's property name Pin
Alaric_16-Jan-09 10:11
professionalAlaric_16-Jan-09 10:11 
AnswerRe: String representation of an object's property name Pin
TommyTomToms16-Jan-09 10:44
TommyTomToms16-Jan-09 10:44 
GeneralRe: String representation of an object's property name Pin
Alaric_16-Jan-09 10:55
professionalAlaric_16-Jan-09 10:55 
GeneralRe: String representation of an object's property name Pin
Jon Rista16-Jan-09 11:47
Jon Rista16-Jan-09 11:47 
GeneralRe: String representation of an object's property name Pin
Alaric_16-Jan-09 13:43
professionalAlaric_16-Jan-09 13:43 
QuestionHi peoples, Pin
Hema Bairavan16-Jan-09 7:07
Hema Bairavan16-Jan-09 7:07 
AnswerRe: Hi peoples, Pin
Thomas Stockwell16-Jan-09 7:47
professionalThomas Stockwell16-Jan-09 7:47 
QuestionNewbie question about TreeNodeCollection vs TreeNode Pin
Rafone16-Jan-09 5:11
Rafone16-Jan-09 5:11 
Hello Fellow Coders;

I'm still struggling with some of the concepts of the treeview in C#. I found this code whick works great. I am trying to figure out how to assign values to the nodes that get added such as the name, text,tag, imageindex, tooltip etc.
This sample is using the TreeNodeCollection can I assign the above properties using this collection??

Here is the code....

TreeNode AddNode(TreeNodeCollection Parent, string text)

{

foreach (TreeNode node in Parent)

{

if (node.Text == text)

return node;

}

return Parent.Add(text);

}



void InsertNodes(TreeNodeCollection treeviewNodes, List<string> _nodes)

{

if (_nodes.Count == 0)

return; //Recursive exit

TreeNode TempNode = AddNode(treeviewNodes, _nodes[0]);

_nodes.RemoveAt(0);

InsertNodes(TempNode.Nodes, _nodes); //Recursive calling

}



private void button1_Click(object sender, EventArgs e)

{

List<string> NODES = new List<string>(); //Save nodes

string[] strArr = textBox1.Text.Split('\\');

foreach (string str in strArr)

NODES.Add(str);

InsertNodes(treeView1.Nodes, NODES);

}




Thanks In Advance
Rafone

Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
AnswerRe: Newbie question about TreeNodeCollection vs TreeNode Pin
Wendelius16-Jan-09 7:54
mentorWendelius16-Jan-09 7:54 
GeneralRe: Newbie question about TreeNodeCollection vs TreeNode Pin
Rafone16-Jan-09 9:17
Rafone16-Jan-09 9:17 
GeneralRe: Newbie question about TreeNodeCollection vs TreeNode Pin
Wendelius16-Jan-09 9:26
mentorWendelius16-Jan-09 9:26 
GeneralRe: Newbie question about TreeNodeCollection vs TreeNode Pin
Rafone16-Jan-09 10:00
Rafone16-Jan-09 10:00 
GeneralRe: Newbie question about TreeNodeCollection vs TreeNode Pin
Wendelius16-Jan-09 10:05
mentorWendelius16-Jan-09 10:05 
GeneralRe: Newbie question about TreeNodeCollection vs TreeNode Pin
Rafone16-Jan-09 10:49
Rafone16-Jan-09 10:49 
QuestionWhat's your suggestion ? Pin
Mohammad Dayyan16-Jan-09 4:56
Mohammad Dayyan16-Jan-09 4:56 
AnswerRe: What's your suggest ? Pin
TylerBrinks16-Jan-09 4:59
TylerBrinks16-Jan-09 4:59 
AnswerRe: What's your suggest ? Pin
User 665816-Jan-09 5:40
User 665816-Jan-09 5:40 
AnswerRe: What's your suggest ? Pin
Wendelius16-Jan-09 6:44
mentorWendelius16-Jan-09 6:44 
GeneralRe: What's your suggest ? Pin
Mohammad Dayyan16-Jan-09 6:53
Mohammad Dayyan16-Jan-09 6:53 
GeneralRe: What's your suggest ? Pin
Wendelius16-Jan-09 7:00
mentorWendelius16-Jan-09 7:00 
QuestionComboBox in a Datagrid Pin
indian14316-Jan-09 3:38
indian14316-Jan-09 3:38 
AnswerRe: ComboBox in a Datagrid Pin
Henry Minute16-Jan-09 4:26
Henry Minute16-Jan-09 4:26 
AnswerRe: ComboBox in a Datagrid Pin
Jim (SS)16-Jan-09 5:34
Jim (SS)16-Jan-09 5:34 
QuestionFull trust network share problem during unit testing vs2008 on vista x64 (caspol solution does not work). Pin
Dennis Dam16-Jan-09 2:53
Dennis Dam16-Jan-09 2:53 
QuestionRetrieve Filenames Distinctively Pin
Vimalsoft(Pty) Ltd16-Jan-09 2:21
professionalVimalsoft(Pty) Ltd16-Jan-09 2:21 

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.