Click here to Skip to main content
15,888,610 members
Home / Discussions / C#
   

C#

 
GeneralRe: What is best for Parent Child List Pin
#realJSOP21-Jul-11 2:31
mve#realJSOP21-Jul-11 2:31 
GeneralRe: What is best for Parent Child List Pin
Anubhava Dimri22-Jul-11 0:20
Anubhava Dimri22-Jul-11 0:20 
AnswerRe: What is best for Parent Child List Pin
OriginalGriff22-Jul-11 3:06
mveOriginalGriff22-Jul-11 3:06 
AnswerRe: What is best for Parent Child List Pin
Shameel21-Jul-11 2:20
professionalShameel21-Jul-11 2:20 
GeneralRe: What is best for Parent Child List Pin
RobCroll22-Jul-11 1:33
RobCroll22-Jul-11 1:33 
GeneralRe: What is best for Parent Child List Pin
Shameel22-Jul-11 4:11
professionalShameel22-Jul-11 4:11 
AnswerRe: What is best for Parent Child List Pin
PIEBALDconsult21-Jul-11 2:52
mvePIEBALDconsult21-Jul-11 2:52 
AnswerRe: What is best for Parent Child List Pin
BobJanova22-Jul-11 3:06
BobJanova22-Jul-11 3:06 
You want a tree. A simple tree (with a single root node) can be created with a class like this:
class TreeNode {
 IList<TreeNode> Children { get; private set; }
 
 // your domain specific data properties here
 
 public TreeNode(){
  Children = new List<TreeNode>();
 }
}


If you want two way linkage you can do
class TreeNode {
 IList<TreeNode> Children { get; private set; }
 TreeNode Parent { get; private set; } 

 // your domain specific data properties here
 
 public TreeNode(TreeNode parent){
  Children = new List<TreeNode>();
  if(parent != null) parent.Children.Add(this);
  Parent = parent;
 }
}


Just store the tree through its root node, unless you want to store other metadata with the tree, in which case you can have a class like
class Tree {
 TreeNode Root { get; private set; }
 
 // anything else you want here 

 public Tree(TreeNode root){
  Root = root;
 }
}

QuestionBinding to multiple data sources Pin
robertalis20-Jul-11 23:27
robertalis20-Jul-11 23:27 
AnswerRe: Binding to multiple data sources Pin
#realJSOP21-Jul-11 0:13
mve#realJSOP21-Jul-11 0:13 
AnswerRe: Binding to multiple data sources Pin
secorbett21-Jul-11 2:20
secorbett21-Jul-11 2:20 
GeneralRe: Binding to multiple data sources Pin
michalrick29-Jul-11 22:10
michalrick29-Jul-11 22:10 
AnswerRe: Binding to multiple data sources Pin
PIEBALDconsult21-Jul-11 2:54
mvePIEBALDconsult21-Jul-11 2:54 
QuestionGet the ancestor nodes from XML Pin
NarVish20-Jul-11 20:57
NarVish20-Jul-11 20:57 
AnswerRe: Get the ancestor nodes from XML Pin
Mirko198020-Jul-11 23:42
Mirko198020-Jul-11 23:42 
GeneralRe: Get the ancestor nodes from XML Pin
NarVish21-Jul-11 0:01
NarVish21-Jul-11 0:01 
AnswerRe: Get the ancestor nodes from XML Pin
PIEBALDconsult21-Jul-11 2:41
mvePIEBALDconsult21-Jul-11 2:41 
QuestionHow can I filterresources from an external assembly by type (text, icons, etc.)? Pin
Erik20-Jul-11 20:31
Erik20-Jul-11 20:31 
QuestionMS Access Query Method Pin
M Riaz Bashir20-Jul-11 19:57
M Riaz Bashir20-Jul-11 19:57 
AnswerRe: MS Access Query Method Pin
Suresh Suthar20-Jul-11 20:49
professionalSuresh Suthar20-Jul-11 20:49 
AnswerRe: MS Access Query Method Pin
GuyThiebaut20-Jul-11 21:44
professionalGuyThiebaut20-Jul-11 21:44 
AnswerRe: MS Access Query Method Pin
Blue_Boy21-Jul-11 1:33
Blue_Boy21-Jul-11 1:33 
GeneralRe: MS Access Query Method Pin
jschell21-Jul-11 9:11
jschell21-Jul-11 9:11 
QuestionStill Struggling to make an autologin app which can automatically fill in the login details as per our URL entered Pin
hackerzpark20-Jul-11 17:30
hackerzpark20-Jul-11 17:30 
AnswerRe: Still Struggling to make an autologin app which can automatically fill in the login details as per our URL entered Pin
Suresh Suthar20-Jul-11 20:46
professionalSuresh Suthar20-Jul-11 20:46 

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.