Click here to Skip to main content
15,895,256 members
Home / Discussions / C#
   

C#

 
GeneralRe: A minor bug?? I hope :s Pin
N a v a n e e t h10-Aug-09 9:29
N a v a n e e t h10-Aug-09 9:29 
GeneralRe: A minor bug?? I hope :s Pin
Muammar©10-Aug-09 10:21
Muammar©10-Aug-09 10:21 
GeneralRe: TreeView Recursion [modified] Pin
Muammar©10-Aug-09 7:45
Muammar©10-Aug-09 7:45 
General[Message Deleted] Pin
Muammar©11-Aug-09 3:13
Muammar©11-Aug-09 3:13 
GeneralRe: TreeView Recursion Pin
N a v a n e e t h11-Aug-09 4:23
N a v a n e e t h11-Aug-09 4:23 
GeneralRe: TreeView Recursion Pin
Muammar©12-Aug-09 3:36
Muammar©12-Aug-09 3:36 
GeneralRe: TreeView Recursion Pin
N a v a n e e t h12-Aug-09 7:17
N a v a n e e t h12-Aug-09 7:17 
GeneralRe: TreeView Recursion Pin
Muammar©12-Aug-09 7:37
Muammar©12-Aug-09 7:37 
Sorry Nav, I know this's becoming a headache but please take a look at this:
private void pop_GTree()
{
    DataTable dt = GenDT("SELECT ID,PARENT,NAME FROM TT ORDER BY ID");

    bool firstIteration = true;
    Node baseLine = null;

    foreach (DataRow row in dt.Rows)
    {
        if (firstIteration)
        {
            baseLine = new Node(int.Parse(row["ID"].ToString()), row["NAME"].ToString());
            treeView1.Nodes.Add(row["ID"].ToString(), row["NAME"].ToString());
            firstIteration = false;
        }
        else
        {
            int parentId = int.Parse(row["PARENT"].ToString());
            Node parent = (baseLine.Id == parentId) ? baseLine : baseLine.FindNode(parentId);

                parent.AddChild(new Node(int.Parse(row["ID"].ToString()), row["NAME"].ToString()));

                treeView1.Nodes[baseLine.FindNode(parent.Id).Id].Nodes.Add(row["ID"].ToString(), row["NAME"].ToString());

        }
    }
    TreeNodeBuilder nodeBuilder = new TreeNodeBuilder(baseLine); // baseline will be root node

}


I'm sorry but I'm totally messed up and I find it difficult to modify your code.. I just need to build it in a treeview directly instead of a seperate node and finally add it and no it's not the same as the control i'm using doesnt support the addition of a treenode with sub nodes, it will just show the first node "the baseline node" while if it's possible to add the nodes one by one in the loop directly to the tree, it will work.. I'll thankful if you can help on this as well dear friend.


GeneralRe: TreeView Recursion Pin
Muammar©12-Aug-09 10:41
Muammar©12-Aug-09 10:41 
AnswerSolved! Pin
Muammar©13-Aug-09 7:10
Muammar©13-Aug-09 7:10 
GeneralRe: Solved! Pin
N a v a n e e t h13-Aug-09 15:37
N a v a n e e t h13-Aug-09 15:37 
GeneralRe: Solved! Pin
Muammar©14-Aug-09 1:16
Muammar©14-Aug-09 1:16 
QuestionTrying to show progress using DownloadDataAsync Pin
steve_rm1-Aug-09 4:23
steve_rm1-Aug-09 4:23 
AnswerRe: Trying to show progress using DownloadDataAsync Pin
Abhijit Jana1-Aug-09 6:18
professionalAbhijit Jana1-Aug-09 6:18 
QuestionRe: Trying to show progress using DownloadDataAsync Pin
Steve1_rm1-Aug-09 6:44
Steve1_rm1-Aug-09 6:44 
AnswerRe: Trying to show progress using DownloadDataAsync Pin
Eddy Vluggen1-Aug-09 7:00
professionalEddy Vluggen1-Aug-09 7:00 
GeneralRe: Trying to show progress using DownloadDataAsync Pin
Steve1_rm1-Aug-09 7:33
Steve1_rm1-Aug-09 7:33 
GeneralRe: Trying to show progress using DownloadDataAsync Pin
Eddy Vluggen1-Aug-09 8:39
professionalEddy Vluggen1-Aug-09 8:39 
AnswerRe: Trying to show progress using DownloadDataAsync Pin
Luc Pattyn1-Aug-09 8:43
sitebuilderLuc Pattyn1-Aug-09 8:43 
AnswerRe: Trying to show progress using DownloadDataAsync Pin
Alan N1-Aug-09 13:57
Alan N1-Aug-09 13:57 
QuestionConnecting C# application to online MS Access database Pin
Alexander Szmidt1-Aug-09 3:43
Alexander Szmidt1-Aug-09 3:43 
AnswerRe: Connecting C# application to online MS Access database Pin
Dave Kreskowiak1-Aug-09 5:10
mveDave Kreskowiak1-Aug-09 5:10 
AnswerRe: Connecting C# application to online MS Access database Pin
nelsonpaixao1-Aug-09 5:12
nelsonpaixao1-Aug-09 5:12 
AnswerRe: Connecting C# application to online MS Access database Pin
Eddy Vluggen1-Aug-09 7:06
professionalEddy Vluggen1-Aug-09 7:06 
QuestionCan I write programs in C # to Micro Controllers Pin
Nasir131-Aug-09 2:33
Nasir131-Aug-09 2:33 

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.