Click here to Skip to main content
15,892,746 members
Home / Discussions / C#
   

C#

 
QuestionThreads issue Pin
HideIvy17-Feb-10 20:18
HideIvy17-Feb-10 20:18 
AnswerRe: Threads issue Pin
Calla17-Feb-10 20:51
Calla17-Feb-10 20:51 
AnswerRe: Threads issue Pin
Mirko198017-Feb-10 21:52
Mirko198017-Feb-10 21:52 
AnswerRe: Threads issue Pin
Nicholas Butler18-Feb-10 0:25
sitebuilderNicholas Butler18-Feb-10 0:25 
QuestionRe: Threads issue Pin
harold aptroot18-Feb-10 0:48
harold aptroot18-Feb-10 0:48 
AnswerRe: Threads issue Pin
David Skelly18-Feb-10 3:03
David Skelly18-Feb-10 3:03 
AnswerRe: Threads issue Pin
HideIvy18-Feb-10 22:28
HideIvy18-Feb-10 22:28 
Questiontreenodecollection nodes not working as expected with created class [SOLVED] Pin
tonyonlinux17-Feb-10 20:07
tonyonlinux17-Feb-10 20:07 
main forum:
private void Filter_combo_SelectedIndexChanged(object sender, EventArgs e)
       {
           /* Populate the tree based on whatever the user selects to filter by
            * for example if they click on keywords then only show the keywords
            */

           string filter = Filter_combo.Text;





           using (var db = new mombooksDataContext(Properties.Settings.Default.BooksConnectionString2))
           {
               NodeBuilder.BuildNodes(treeView1.Nodes,db.Authors, db.Books, filter);
               treeView1.Nodes.Clear();//get rid of t his after we're done.

           }
       }


class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using momdb;

namespace Utilties
{
    public sealed class NodeBuilder
    {
        public static void BuildNodes(TreeNodeCollection nodes,IEnumerable<Author>authors, IEnumerable<Book> books, string filter)
        {
            
            if (filter == "Keywords" || filter == "Title")
            {
                books.ToList().ForEach(m =>
                    {
                        TreeNode node = new TreeNode(filter);
                        node.Tag = m;
                        nodes.Add(node);
                    });
            }
           if (filter =="Author")
           {
               authors.ToList().ForEach(m =>
                {
                TreeNode node =new TreeNode(filter); 
                node.Tag=m;
                nodes.Add(node);
                 }); 
           }
        }
    }


whenever i do this I never get any results to my treeview and I can't really comprehend why not. I'm passing it the nodes and I would think it would populate the tree from those nodes Frown | :(
modified on Friday, February 19, 2010 11:00 PM

AnswerRe: treenodecollection nodes not working as expected with created class Pin
Dan Mos17-Feb-10 20:28
Dan Mos17-Feb-10 20:28 
GeneralRe: treenodecollection nodes not working as expected with created class [SOLVED] Pin
tonyonlinux18-Feb-10 1:07
tonyonlinux18-Feb-10 1:07 
GeneralRe: treenodecollection nodes not working as expected with created class Pin
tonyonlinux18-Feb-10 1:31
tonyonlinux18-Feb-10 1:31 
GeneralRe: treenodecollection nodes not working as expected with created class Pin
Dan Mos18-Feb-10 2:40
Dan Mos18-Feb-10 2:40 
GeneralRe: treenodecollection nodes not working as expected with created class Pin
tonyonlinux18-Feb-10 6:43
tonyonlinux18-Feb-10 6:43 
GeneralRe: treenodecollection nodes not working as expected with created class Pin
Dan Mos18-Feb-10 10:03
Dan Mos18-Feb-10 10:03 
GeneralRe: treenodecollection nodes not working as expected with created class Pin
tonyonlinux18-Feb-10 13:18
tonyonlinux18-Feb-10 13:18 
GeneralRe: treenodecollection nodes not working as expected with created class Pin
Dan Mos18-Feb-10 13:34
Dan Mos18-Feb-10 13:34 
GeneralRe: treenodecollection nodes not working as expected with created class Pin
tonyonlinux19-Feb-10 17:00
tonyonlinux19-Feb-10 17:00 
QuestionHow to set a property in a collection based on the join? Pin
sri_346417-Feb-10 20:04
sri_346417-Feb-10 20:04 
AnswerRe: How to set a property in a collection based on the join? Pin
Dan Mos17-Feb-10 20:36
Dan Mos17-Feb-10 20:36 
QuestionSaving Data on a Form Pin
thomas_anderson17-Feb-10 18:00
thomas_anderson17-Feb-10 18:00 
AnswerRe: Saving Data on a Form Pin
AspDotNetDev17-Feb-10 18:33
protectorAspDotNetDev17-Feb-10 18:33 
GeneralRe: Saving Data on a Form Pin
thomas_anderson17-Feb-10 20:23
thomas_anderson17-Feb-10 20:23 
GeneralRe: Saving Data on a Form Pin
Richard MacCutchan17-Feb-10 21:46
mveRichard MacCutchan17-Feb-10 21:46 
GeneralRe: Saving Data on a Form Pin
thomas_anderson20-Feb-10 11:28
thomas_anderson20-Feb-10 11:28 
GeneralRe: Saving Data on a Form Pin
AspDotNetDev17-Feb-10 21:47
protectorAspDotNetDev17-Feb-10 21:47 

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.