Treeview drives me crazy!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Martin

    Treeview drives me crazy!

    I have a treeview control, which is docked on a panel. When I call the
    procedure to fill this treeview from the load event it works fine. It loads
    all nodes, and displays them nicely.

    However, when I call the very same procedure at a later stage (after a
    login) then the nodes don't show. I traced with the debugger, and the nodes
    do get created, but when I check the IsVisible property, it is set to No.

    So, now comes the weirdest part... I cut the procedure that fills the
    treeview in two. The first part loads header nodes, which are the same for
    every user. I call this procedure from the load event. Then after the login
    I call the 2nd part, which adds child nodes to the previously created header
    nodes. When the form shows, the header nodes are shown, the later added
    child nodes are not. Again, they do exist, but I can't seem to make them
    visible... What's going on here?

    Tia,
    Martin



  • gregory_may

    #2
    Re: Treeview drives me crazy!

    Is the update procedure in the same thread context as the UI?

    "Martin" <x@y.com> wrote in message
    news:OoQira7MGH A.344@TK2MSFTNG P11.phx.gbl...[color=blue]
    >I have a treeview control, which is docked on a panel. When I call the
    >procedure to fill this treeview from the load event it works fine. It loads
    >all nodes, and displays them nicely.
    >
    > However, when I call the very same procedure at a later stage (after a
    > login) then the nodes don't show. I traced with the debugger, and the
    > nodes do get created, but when I check the IsVisible property, it is set
    > to No.
    >
    > So, now comes the weirdest part... I cut the procedure that fills the
    > treeview in two. The first part loads header nodes, which are the same for
    > every user. I call this procedure from the load event. Then after the
    > login I call the 2nd part, which adds child nodes to the previously
    > created header nodes. When the form shows, the header nodes are shown, the
    > later added child nodes are not. Again, they do exist, but I can't seem to
    > make them visible... What's going on here?
    >
    > Tia,
    > Martin
    >
    >
    >[/color]


    Comment

    • Martin

      #3
      Re: Treeview drives me crazy!

      Hi Gregory,

      Thanks for your reply. I'm a long-time VB6 programmer, just starting in
      VB2005 and I have to admit: I don't even know what a thread context is.
      However.. I did create a class which is instanced within my app as a
      seperate object, like a kind of "Handler". This handler is executing the
      method of the MDI container form to display the remaining nodes. But I don't
      think that would be a seperate thread, and the method to display these nodes
      is still in the MDI container form.

      Tia,
      Martin

      "gregory_ma y" <None> wrote in message
      news:O3KcKB%23M GHA.2036@TK2MSF TNGP14.phx.gbl. ..[color=blue]
      > Is the update procedure in the same thread context as the UI?
      >
      > "Martin" <x@y.com> wrote in message
      > news:OoQira7MGH A.344@TK2MSFTNG P11.phx.gbl...[color=green]
      >>I have a treeview control, which is docked on a panel. When I call the
      >>procedure to fill this treeview from the load event it works fine. It
      >>loads all nodes, and displays them nicely.
      >>
      >> However, when I call the very same procedure at a later stage (after a
      >> login) then the nodes don't show. I traced with the debugger, and the
      >> nodes do get created, but when I check the IsVisible property, it is set
      >> to No.
      >>
      >> So, now comes the weirdest part... I cut the procedure that fills the
      >> treeview in two. The first part loads header nodes, which are the same
      >> for every user. I call this procedure from the load event. Then after the
      >> login I call the 2nd part, which adds child nodes to the previously
      >> created header nodes. When the form shows, the header nodes are shown,
      >> the later added child nodes are not. Again, they do exist, but I can't
      >> seem to make them visible... What's going on here?
      >>
      >> Tia,
      >> Martin
      >>
      >>
      >>[/color]
      >
      >[/color]


      Comment

      • Martin

        #4
        Re: Treeview drives me crazy!

        Hi Gregory,

        That was the problem! Thanks for pointing me in the right direction.

        Martin

        "gregory_ma y" <None> wrote in message
        news:O3KcKB%23M GHA.2036@TK2MSF TNGP14.phx.gbl. ..[color=blue]
        > Is the update procedure in the same thread context as the UI?
        >
        > "Martin" <x@y.com> wrote in message
        > news:OoQira7MGH A.344@TK2MSFTNG P11.phx.gbl...[color=green]
        >>I have a treeview control, which is docked on a panel. When I call the
        >>procedure to fill this treeview from the load event it works fine. It
        >>loads all nodes, and displays them nicely.
        >>
        >> However, when I call the very same procedure at a later stage (after a
        >> login) then the nodes don't show. I traced with the debugger, and the
        >> nodes do get created, but when I check the IsVisible property, it is set
        >> to No.
        >>
        >> So, now comes the weirdest part... I cut the procedure that fills the
        >> treeview in two. The first part loads header nodes, which are the same
        >> for every user. I call this procedure from the load event. Then after the
        >> login I call the 2nd part, which adds child nodes to the previously
        >> created header nodes. When the form shows, the header nodes are shown,
        >> the later added child nodes are not. Again, they do exist, but I can't
        >> seem to make them visible... What's going on here?
        >>
        >> Tia,
        >> Martin
        >>
        >>
        >>[/color]
        >
        >[/color]


        Comment

        • gregory_may

          #5
          Re: Treeview drives me crazy!

          This issue is a weird one. I manifests it self in strange ways. The .Net
          framework seems to just blow apart with this issue.

          "Martin" <x@y.com> wrote in message
          news:%236$RIMHN GHA.1424@TK2MSF TNGP12.phx.gbl. ..[color=blue]
          > Hi Gregory,
          >
          > That was the problem! Thanks for pointing me in the right direction.
          >
          > Martin
          >
          > "gregory_ma y" <None> wrote in message
          > news:O3KcKB%23M GHA.2036@TK2MSF TNGP14.phx.gbl. ..[color=green]
          >> Is the update procedure in the same thread context as the UI?
          >>
          >> "Martin" <x@y.com> wrote in message
          >> news:OoQira7MGH A.344@TK2MSFTNG P11.phx.gbl...[color=darkred]
          >>>I have a treeview control, which is docked on a panel. When I call the
          >>>procedure to fill this treeview from the load event it works fine. It
          >>>loads all nodes, and displays them nicely.
          >>>
          >>> However, when I call the very same procedure at a later stage (after a
          >>> login) then the nodes don't show. I traced with the debugger, and the
          >>> nodes do get created, but when I check the IsVisible property, it is set
          >>> to No.
          >>>
          >>> So, now comes the weirdest part... I cut the procedure that fills the
          >>> treeview in two. The first part loads header nodes, which are the same
          >>> for every user. I call this procedure from the load event. Then after
          >>> the login I call the 2nd part, which adds child nodes to the previously
          >>> created header nodes. When the form shows, the header nodes are shown,
          >>> the later added child nodes are not. Again, they do exist, but I can't
          >>> seem to make them visible... What's going on here?
          >>>
          >>> Tia,
          >>> Martin
          >>>
          >>>
          >>>[/color]
          >>
          >>[/color]
          >
          >[/color]


          Comment

          Working...