Re: Deleting a node from TreeView

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Leif (Leif_at_discussions.microsoft.com)
Date: 02/13/05


Date: Sat, 12 Feb 2005 19:49:03 -0800

Rob,

Thanks for your reply. I was afraid of that. I probably could use an array
to store the states, but I'm not sure its worth the effort. I see what the
client thinks.

On your problem, I goggled it and came up with the following. Hope it helps.

Receive an Error Like "The object invoked has disconnected from its clients"
and Must Re-Start the Application in Order to Perform Certain Activities
Issue:

A rare/intermittent issue has been observed when using ReliaSoft's software
products on Windows 2000 and some Windows NT systems with 2000 libraries. An
error like "The object invoked has disconnected from its clients" appears and
the user is unable to perform functions associated with the object
disconnect. The problem is resolved by re-starting the application.

Solution:

This problem is due to an issue with Windows 2000, not ReliaSoft software,
as confirmed by Microsoft. Microsoft's support document number Q293631
describes the issue. Microsoft has made a hot fix available and has announced
plans to address this issue with a service pack.

"Rob Parker" wrote:

> AFAIK, there is no delete method for nodes in a treeview control. Your
> approach - repopulate the tree - is the only way to do it.
>
> What you can do, though, is to set the expanded property of each node as you
> add it. This allows you to open the tree in any state you want it. If you
> want/need to open it in its previous state (an unknown mix of true/false
> values for each node's expanded property), you'll need to add a field to the
> table that the tree is based on, store the appropriate value in it when you
> are processing node clicks, and use that in the recordset when you
> re-populate the treee to restore its previous state.
>
> HTH,
>
> Rob
>
> BTW, if you can tell me why I keep getting Run-Time Error -2147417848
> "Automation error. The object invoked has disconnected from its clients@@"
> in a treeview control I'd be eternally grateful! I've used treeview
> controls in a couple of databases with no problems, but in another one I get
> this error with monotonous regularity - and it usually crashes the whole
> application!
>
>
> "Leif" <Leif@discussions.microsoft.com> wrote in message
> news:A1CAC8C7-ACF3-4F5D-AB2E-9B7982B124DD@microsoft.com...
> > I would like to delete a node from treeview. I can add, I can rename, but
> I
> > don't see a delete method. The work around I've tried is to delete the
> > record from the table, clear treeview, then repopulate the tree. However,
> > after doing that my tree is collapsed. Is there a better way to do a
> delete?
> >
> > Thanks,
> > Leif
>
>
>



Relevant Pages

  • Tree structure
    ... What would be the best approach to store and access a tree structure in Sybase? ... (n-ary tree like Explorer under Windows, ... To avoid multiple transactions, I think I should store the tree in an array or other at the beginning of program. ...
    (comp.databases.sybase)
  • Re: TreeView flashing when resizing form - but only as a Dialog WHY?
    ... I discovered that the tree flickering only happens on XP when the XP themes ... If the "Windows classic" style is used, ... my main form has a splitter with a TreeView ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: TreeView to MySQL Database
    ... Are you trying to store the nodes in the ... tree view, or are you trying to store the style of the control? ... the treeview that will help you persist this information. ... > Preferably as Blob... ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Dire TreeView performance in .Net 2.0 vs 1.1
    ... BeginUpdate/EndUpdate route. ... Sadly it makes the tree unusable with it turned ... garbage TreeView control in .Net 2.0 should be summarily shot. ... secs (with BeginUpdate and updating .Text) ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Dire TreeView performance in .Net 2.0 vs 1.1
    ... the tree loads a few thousand nodes rather quickly for me. ... a percentage within its siblings or are the percentages ... TreeView control and the changes appear to be not for the better as far ...
    (microsoft.public.dotnet.framework.windowsforms)