Click here to Skip to main content
15,921,226 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: listview control problem Pin
Christian Graus9-Aug-05 16:29
protectorChristian Graus9-Aug-05 16:29 
GeneralRe: listview control problem Pin
venadder9-Aug-05 16:33
venadder9-Aug-05 16:33 
GeneralRe: listview control problem Pin
Christian Graus9-Aug-05 16:37
protectorChristian Graus9-Aug-05 16:37 
Generalurgent help with treeview control Pin
BORN...again!9-Aug-05 16:00
BORN...again!9-Aug-05 16:00 
GeneralRe: urgent help with treeview control Pin
Christian Graus9-Aug-05 16:03
protectorChristian Graus9-Aug-05 16:03 
GeneralRe: urgent help with treeview control Pin
BORN...again!9-Aug-05 16:12
BORN...again!9-Aug-05 16:12 
GeneralRe: urgent help with treeview control Pin
Christian Graus9-Aug-05 16:27
protectorChristian Graus9-Aug-05 16:27 
GeneralRe: urgent help with treeview control Pin
BORN...again!9-Aug-05 16:41
BORN...again!9-Aug-05 16:41 
Hi again,

Looks like this solution will work excpet that I am getting the foll error:

"'Private Sub LabelChildNodes(TreeNode As Object)'."



I use Vb.net and I wrote your function as follows :




'************************************************************************<br />
    Private Sub LabelChildNodes(TreeNode node, Boolean recurse)<br />
{<br />
Dim child As TreeNode<br />
For Each child In node.Nodes<br />
Dim count As String =  String.Format(" ({0})",child.Nodes.Count)<br />
<br />
child.Text = child.Text + count<br />
<br />
if (recurse)<br />
{<br />
LabelChildNodes(child, recurse)<br />
}<br />
Next<br />
}<br />
<br />
End sub<br />
'************************************************************************


and called it here:

Function CreateTree(myDs as Dataset)<br />
<br />
         'Create the Row Objects that are needed for the ForEach Loop<br />
          Dim RowBranch as DataRow<br />
          Dim RowDepartment as DataRow<br />
          Dim RowPerson as DataRow<br />
<br />
         'Run trough all Branches<br />
          For each RowBranch in myDS.Tables("branch").Rows<br />
             'Create a new TreeNode Object<br />
              Dim NewBranch As new Microsoft.Web.Ui.Webcontrols.TreeNode()<br />
              'Define a Text that is displayed for the new Node<br />
              NewBranch.Text = RowBranch("braname")<br />
              'Define a Id for the Node<br />
              NewBranch.Id = RowBranch("branchID")<br />
              'Give the Node a Tree Node Typ, so that the TreeNode Branch look different from department, Person<br />
              NewBranch.Type = "Branch"<br />
              'Define NavigateURL per Node, because new Page need the ID and retriev Data from the Database per ID<br />
              NewBranch.NavigateURL = "javascript:var win=window.open('branch_detail.aspx?ID=" & RowBranch("branchID") & "','','width=400,height=400')"<br />
              'Add the Node to the Tree<br />
              TreeView.Nodes.Add(NewBranch)<br />
              'treeview.nodes.add("key")<br />
     ---HERE---         LabelChildNodes(treeView.Nodes(0), True)<br />
<br />
'***********************************************************


Any further help?

Thanks a lot for prompt help, I am sure my manager will be happy at the end Smile | :)

aartee.

arty=me
GeneralRe: urgent help with treeview control Pin
Christian Graus9-Aug-05 17:05
protectorChristian Graus9-Aug-05 17:05 
GeneralRe: urgent help with treeview control Pin
BORN...again!9-Aug-05 18:28
BORN...again!9-Aug-05 18:28 
GeneralRe: urgent help with treeview control Pin
Christian Graus9-Aug-05 18:32
protectorChristian Graus9-Aug-05 18:32 
GeneralNeed help!!!!! Pin
DesertWrangler9-Aug-05 13:18
DesertWrangler9-Aug-05 13:18 
GeneralRe: Need help!!!!! Pin
Christian Graus9-Aug-05 14:47
protectorChristian Graus9-Aug-05 14:47 
GeneralRe: Need help!!!!! Pin
DesertWrangler10-Aug-05 10:16
DesertWrangler10-Aug-05 10:16 
GeneralRe: Need help!!!!! Pin
Christian Graus10-Aug-05 10:29
protectorChristian Graus10-Aug-05 10:29 
GeneralRe: Need help!!!!! Pin
DesertWrangler10-Aug-05 10:43
DesertWrangler10-Aug-05 10:43 
GeneralRe: Need help!!!!! Pin
Christian Graus10-Aug-05 11:17
protectorChristian Graus10-Aug-05 11:17 
GeneralRe: Need help!!!!! Pin
dptalt11-Aug-05 5:34
dptalt11-Aug-05 5:34 
Generalscreen size conversion Pin
utservoalius9-Aug-05 13:13
utservoalius9-Aug-05 13:13 
Generalorder by clause in XML Pin
Rizwan Bashir9-Aug-05 10:11
Rizwan Bashir9-Aug-05 10:11 
GeneralGot it Pin
Rizwan Bashir9-Aug-05 10:21
Rizwan Bashir9-Aug-05 10:21 
QuestionHow to modify or extract files from existing MFC application Pin
Zain suri9-Aug-05 10:00
Zain suri9-Aug-05 10:00 
AnswerRe: How to modify or extract files from existing MFC application Pin
Christian Graus9-Aug-05 13:48
protectorChristian Graus9-Aug-05 13:48 
GeneralSending and catching strings from a DLL Pin
Swim-13nrv9-Aug-05 4:30
Swim-13nrv9-Aug-05 4:30 
GeneralRe: Sending and catching strings from a DLL Pin
Dave Kreskowiak9-Aug-05 5:11
mveDave Kreskowiak9-Aug-05 5:11 

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.