Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Basic C# question
Message
From
06/07/2006 04:55:59
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
05/07/2006 21:42:01
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01133939
Message ID:
01134063
Views:
18
>>Maybe:
>>
>>for (int i = 0,nCount = this.TreeView1.Nodes.Count; i < nCount; i++)
>>{
>>// however question is: operation might depend on realtime
>>// nodes count? or a reverse iteration, count to 0?
>>// maybe you'd want to use a foreach() instead which uses an enumerator?
>>
>>// foreach(TreeNode node in myTree.Nodes)
>>}
>>
Unlike VFP's for, condition is a boolean and it is a version of while{} (and by language definition conditon is reevaluated each time). ie:
>>
>>for(int i=0,j=5;i<j;i++)
>>{
>> Console.WriteLine("i:{0} j:{1}",i,j);
>> j--;
>>}
>>
PS: Also it matters which Treeview control is this. Web or Windows.
>>Cetin
>

>
>Interesting idea. Let me ponder it a while and try it tomorrow at work. It is a web (ASP.NET 2.0) TreeView.

If web then (check that I might be wrong) TV.Nodes.count is not the count of all nodes available but root nodes.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform