Click here to Skip to main content
15,896,118 members
Home / Discussions / C#
   

C#

 
AnswerRe: Drag&Drop over RichTextBox showing wrong DropEffect Pin
Xmen Real 16-Feb-09 7:54
professional Xmen Real 16-Feb-09 7:54 
GeneralRe: Drag&Drop over RichTextBox showing wrong DropEffect Pin
mav.northwind16-Feb-09 8:41
mav.northwind16-Feb-09 8:41 
GeneralRe: Drag&Drop over RichTextBox showing wrong DropEffect Pin
Xmen Real 16-Feb-09 13:44
professional Xmen Real 16-Feb-09 13:44 
QuestionSee the execution path of my program Pin
anderslundsgard16-Feb-09 5:17
anderslundsgard16-Feb-09 5:17 
AnswerRe: See the execution path of my program Pin
Eddy Vluggen16-Feb-09 7:36
professionalEddy Vluggen16-Feb-09 7:36 
QuestionShow Repeating Data Pin
Terick16-Feb-09 4:44
Terick16-Feb-09 4:44 
QuestionDesigning Menu/tool bar system takes action depending on control displayed Pin
SilimSayo16-Feb-09 4:38
SilimSayo16-Feb-09 4:38 
QuestionTreeView-Error Pin
Udayaraju16-Feb-09 3:33
Udayaraju16-Feb-09 3:33 
Here I am trying to fill the tree view category and subcategory wise..see the below

|Benson and Hedges
|Kings Gold Falke
Beverages
| |-Beers
| |-Bell Lager 500 ML
| |-CLUB PILSENER 500 ML
| |-Juices
| |-Apple Juice
| |-Chikooo Juice
|-Food
| |-MeatProducts
| |-GOAT MEAT
| |-Fruits
| |-APPLE GREEN
| |-LOCAL ORANGES
|-VegeTable |
| |-BEETROOT
| |-TOMATO FRESH

I have tried the following code..but I am able to fill only one product under one sub category. Please help me out how to??initialize and fill the data into tree view
foreach (DataRow row in table.Rows)
                {
                    MainNode = new TreeNode(row.ItemArray[0].ToString());
                    MainNode.Name = row.ItemArray[0].ToString();
                    if (MainNode.Text == "")
                    {
			//Stmts
                       }
                       
                    else
                    {
                        ChildNode = new TreeNode(row.ItemArray[1].ToString());
                        ChildNode.Name = row.ItemArray[1].ToString();
                        if (ChildNode.Text == "")
                        {
                            ChildNode = new TreeNode(row.ItemArray[3].ToString());
                            ChildNode.Name = row.ItemArray[3].ToString();
                            ChildNode.Tag = row.ItemArray[2].ToString();
                            if (!MainNode.Nodes.ContainsKey(ChildNode.Name))
                            {
                                MainNode.Nodes.Add(ChildNode);
                            } }
                        else
                        {
                            SubNode = new TreeNode(row.ItemArray[3].ToString());
                            SubNode.Name = row.ItemArray[3].ToString();
                            SubNode.Tag = row.ItemArray[2].ToString();
                            if (!ChildNode.Nodes.ContainsKey(SubNode.Name))
                            {
                                ChildNode.Nodes.Add(SubNode);
                            } }
                        if (!MainNode.Nodes.ContainsKey(ChildNode.Name))
                        {
                            MainNode.Nodes.Add(ChildNode);
                        }
                        else
                        {
//Here I am unable to understand how to fill child nodes into mainnode
//The below code is wrong 
                            for (int i = 0; i <= MainNode.Nodes.Count; i++)
                            {                               MainNode.Nodes.Add(ChildNode);                                
                            }                   }
                        if (!RootNode.Nodes.ContainsKey(MainNode.Name))
                        {
                            RootNode.Nodes.Add(MainNode);                            
                        }                    }                }            }

AnswerRe: TreeView-Error Pin
Xmen Real 16-Feb-09 7:34
professional Xmen Real 16-Feb-09 7:34 
GeneralRe: TreeView-Error Pin
Udayaraju16-Feb-09 8:06
Udayaraju16-Feb-09 8:06 
GeneralRe: TreeView-Error Pin
Xmen Real 16-Feb-09 8:08
professional Xmen Real 16-Feb-09 8:08 
QuestionDataGridView doesn't display anything. Pin
AxiliuM16-Feb-09 3:04
AxiliuM16-Feb-09 3:04 
AnswerRe: DataGridView doesn't display anything. Pin
Calin Tatar16-Feb-09 7:21
Calin Tatar16-Feb-09 7:21 
GeneralRe: DataGridView doesn't display anything. Pin
AxiliuM16-Feb-09 10:22
AxiliuM16-Feb-09 10:22 
GeneralRe: DataGridView doesn't display anything. Pin
Calin Tatar16-Feb-09 22:05
Calin Tatar16-Feb-09 22:05 
QuestionSystem.Net.Webexcpetion Pin
MamthaLalith16-Feb-09 2:01
MamthaLalith16-Feb-09 2:01 
AnswerRe: System.Net.Webexcpetion Pin
EliottA16-Feb-09 2:02
EliottA16-Feb-09 2:02 
GeneralRe: System.Net.Webexcpetion Pin
MamthaLalith16-Feb-09 2:08
MamthaLalith16-Feb-09 2:08 
GeneralRe: System.Net.Webexcpetion Pin
EliottA16-Feb-09 2:10
EliottA16-Feb-09 2:10 
GeneralRe: System.Net.Webexcpetion Pin
MamthaLalith16-Feb-09 2:15
MamthaLalith16-Feb-09 2:15 
GeneralRe: System.Net.Webexcpetion Pin
EliottA16-Feb-09 2:18
EliottA16-Feb-09 2:18 
GeneralRe: System.Net.Webexcpetion Pin
MamthaLalith16-Feb-09 2:21
MamthaLalith16-Feb-09 2:21 
GeneralRe: System.Net.Webexcpetion Pin
musefan16-Feb-09 2:22
musefan16-Feb-09 2:22 
GeneralRe: System.Net.Webexcpetion Pin
MamthaLalith16-Feb-09 2:26
MamthaLalith16-Feb-09 2:26 
JokeRe: System.Net.Webexcpetion Pin
musefan16-Feb-09 2:19
musefan16-Feb-09 2:19 

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.