Click here to Skip to main content
15,890,557 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: How to Access WMI From Server 2008 to Windows XP Pin
Dave Kreskowiak27-Dec-08 5:54
mveDave Kreskowiak27-Dec-08 5:54 
Questiondatagridview Pin
kulandaivel_mca200726-Dec-08 22:15
kulandaivel_mca200726-Dec-08 22:15 
AnswerRe: Crosspost Pin
Brij26-Dec-08 23:44
mentorBrij26-Dec-08 23:44 
GeneralRe: Crosspost Pin
kulandaivel_mca200727-Dec-08 0:02
kulandaivel_mca200727-Dec-08 0:02 
AnswerRe: datagridview Pin
Aman Bhullar27-Dec-08 23:00
Aman Bhullar27-Dec-08 23:00 
QuestionWMI "Access is Denied" Pin
priyapriyam26-Dec-08 20:52
priyapriyam26-Dec-08 20:52 
AnswerRe: WMI "Access is Denied" Pin
Dave Kreskowiak27-Dec-08 5:55
mveDave Kreskowiak27-Dec-08 5:55 
QuestionBase element load twice in TreeView, please help. Pin
Musa Biralo26-Dec-08 2:40
Musa Biralo26-Dec-08 2:40 
Hello everybody,

This is my first post here and I am learning .NET so please excuse my baby steps.
I am trying to load the elements in tree view. My base item is loading two times. I know why it's loading but i don't know how to protect it or what's the other method so that base item will not load twice.

Thanks. Here is the code.

Private Sub LoadScenarios()

	For Each aScenarioBase As MmScenario In aDataSet()
		Dim baseScenarioTreeNode As TreeNode = Me.tvScenario.Nodes.Add(aScenarioBase.Id.ToString, aScenarioBase.Label)
		LoadScenariosAndChildren(aScenarioBase, baseScenarioTreeNode)
	Next

End Sub

Private Sub LoadScenariosAndChildren(ByVal aScenarioParent As MmScenario, ByVal parentScenarioTreeNode As TreeNode)
	Dim childScenarioTreeNode As TreeNode = parentScenarioTreeNode.Nodes.Add(aScenarioParent.Id.ToString, aScenarioParent.Label)

	For Each aScenario As IScenario In aScenarioParent.Children()
		LoadScenariosAndChildren(aScenario, childScenarioTreeNode)
	Next
End Sub


Results:
0000
0000
0001
0001.1
0002

I want:
0000
0001
0001.1
0002

Many Thanks.
AnswerRe: Base element load twice in TreeView, please help. Pin
Not Active26-Dec-08 3:09
mentorNot Active26-Dec-08 3:09 
GeneralRe: Base element load twice in TreeView, please help. Pin
Musa Biralo26-Dec-08 3:21
Musa Biralo26-Dec-08 3:21 
GeneralRe: Base element load twice in TreeView, please help. Pin
Not Active26-Dec-08 3:45
mentorNot Active26-Dec-08 3:45 
GeneralRe: Base element load twice in TreeView, please help. Pin
Musa Biralo26-Dec-08 4:15
Musa Biralo26-Dec-08 4:15 
GeneralRe: Base element load twice in TreeView, please help. Pin
Musa Biralo26-Dec-08 4:18
Musa Biralo26-Dec-08 4:18 
GeneralRe: Base element load twice in TreeView, please help. Pin
Not Active26-Dec-08 4:59
mentorNot Active26-Dec-08 4:59 
Questiondatagridview using c# Pin
kulandaivel_mca200726-Dec-08 0:08
kulandaivel_mca200726-Dec-08 0:08 
QuestionRun .Net1.1 and 2.0 at same time Pin
Vince.Ro25-Dec-08 17:30
Vince.Ro25-Dec-08 17:30 
AnswerRe: Run .Net1.1 and 2.0 at same time Pin
Brij25-Dec-08 17:58
mentorBrij25-Dec-08 17:58 
GeneralRe: Run .Net1.1 and 2.0 at same time Pin
Vince.Ro25-Dec-08 18:50
Vince.Ro25-Dec-08 18:50 
GeneralRe: Run .Net1.1 and 2.0 at same time Pin
Abhijit Jana25-Dec-08 20:24
professionalAbhijit Jana25-Dec-08 20:24 
GeneralRe: Run .Net1.1 and 2.0 at same time Pin
Vince.Ro25-Dec-08 22:42
Vince.Ro25-Dec-08 22:42 
GeneralRe: Run .Net1.1 and 2.0 at same time Pin
Brij25-Dec-08 22:59
mentorBrij25-Dec-08 22:59 
GeneralRe: Run .Net1.1 and 2.0 at same time Pin
Vince.Ro28-Dec-08 13:44
Vince.Ro28-Dec-08 13:44 
QuestionInterface and GetType() - works in C# but not in VB? Pin
David Hovey25-Dec-08 12:37
David Hovey25-Dec-08 12:37 
AnswerRe: Interface and GetType() - works in C# but not in VB? Pin
cterrinw27-Sep-09 19:32
cterrinw27-Sep-09 19:32 
GeneralRe: Interface and GetType() - works in C# but not in VB? Pin
David Hovey27-Sep-09 19:37
David Hovey27-Sep-09 19:37 

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.