Re: TreeView Node Delete

Would anyone know of an efficient way to remove DisplayNode-type nodesfrom
a treeview? I am trying to simply code
DeleteTreeNode (node: DisplayNode)
Node.parent.FirstChild = node.NextSibling;
(DisplayNode)(Node.parent).UpdateFieldFromData;
Node = Nil;
However, this is not working...Node.Parent = NIL ;
The TreeView will figure out the rest.
=================================================
[email protected] Stephen Semeniuk
Sentai Advanced Research Corporation
The moving cursor writes, and having written, blinks on.

Geoffrey -
You may not even want to write this method, since the following line of
code will do just as well:
node.Parent = NIL;
As for the Related attribute, you can put anything you want in there; Forte
does not use that attribute for anything. I usually use the Related
attribute to reference the object that I am displaying. For example, if
the tree is displaying a corporate hierarchy, the Related attribute will
reference an Employee object.
I am not sure what you mean by a "profound performance issue", but if you
are concerned about storing as little data on the client as possible, there
is a useful technique. Do not load in data for nodes that you will not be
displaying, and then create nodes when they are needed to be displayed
(listen for the RequestFolderOpen event). You can also handle the
RequestFolderClose event, and then remove nodes that are not displayed.
However, you are best off to create some tests for different numbers of
nodes at different levels, and then see what the actual performance is.
There are many variables that will affect performance, so you will need to
construct a few simple scenarios. If the existing performance is
satisfactory for the amount of data you will be viewing, then there is no
need for additional optimizations.
I'm happy to give you further ideas on this.
Regards
CSB
At 10:47 AM 3/2/98 -0500, Geoffrey Whittington wrote:
Would anyone know of an efficient way to remove DisplayNode-type nodes from
a treeview? I am trying to simply code
DeleteTreeNode (node: DisplayNode)
Node.parent.FirstChild = node.NextSibling;
(DisplayNode)(Node.parent).UpdateFieldFromData;
Node = Nil;
However, this is not working...
Also: the attribute of 'Related' on a DisplayNode is of type Object. I
believe that it can reference any type of object. Can someone tell me if
there has been a known problem with using this attribute to contain
references to other allocated objects? Is there a profound performance
issue with a treeview with 200+ nodes?
Thanks!
Geoffrey Whittington
Software Engineer, Descartes Systems Group Inc.
[email protected]
(519)746-8110 x2333
Curtis Bragdon, Forte Consulting
[email protected]
Voice Mail: (510) 986-3807
Paging: (888) 687-6723
"I've seen dozens of triggering towns." - Richard Hugo

Similar Messages

  • How to blink TreeView Nodes based on condition c#

    suppose i am populating my tree view with data from database and i want to blink those nodes which has a specific data. now guide me with code how can i efficiently blink multiple tree view nodes  based on condition in winform application.

    Hi Mou_kolkata,
    >> anyone can give me small working code for tree node blinking
    Thank Armin for the details about blinking TreeView Nodes.
    For a simple demo to blink TreeView nodes, you could refer the link below:
    # Treeview control - How to make a node blink?
    https://social.msdn.microsoft.com/Forums/en-US/64e7a4d7-3098-4370-990f-390cb3a640a1/treeview-control-how-to-make-a-node-blink
    If you have issues when you blink Treeview nodes, please feel free to post a new thread in this forum, then you would get more help.
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Program to add node /  delete node in the tree control via abap object

    Hi all,
    i am new to abap objects.
    Can anyone help me out to give program about add node , delete node at
    a particular point in tree hierarchy.
    folder1                     -- level 1
    subfolder1          -- level 2
    *********subfolder1   -- level 3
    *********subfolder2  -- level 3
    subfolder2          -- level 2
    folder2                     -- level 1
    if i select level3 and click on ADD button .....i get a facility to add new node
    at level 3 and and same thing can happen at level1 and level2 ............ if i select
    and folder at level3 and click on delete button ....it should delete that folder...
    if you do not have such program ........then guide me how to achieve this target via object oriented because i have to split the screen also and have to show some alve display in that.
    just guide me how to add and delete node at a particular level in tree structure....
    thanks in advance........

    Hello Ravi,
    Try this demo program:
    <b>BCALV_TREE_01</b>
    <b>BCALV_TREE_DEMO</b>
    BCALV_TREE_SIMPLE_DEMO
    Also try:
    BCALV_TREE_02
    BCALV_TREE_03
    BCALV_TREE_04
    BCALV_TREE_05
    BCALV_TREE_06
    regards,
    Beejal
    **reward if this helps

  • How to prevent Node deletion

    Hi,
    Is it possible in DRM to have a validation for not deleting of node having some particular mapping conditions or properties assigned.
    Can we prevent node deletion with validation rules.

    Yes, you can use a validation with Class = PropRemove and Level = Remove, then specify a combination of up to three property values to trigger validation failure.  Easiest is to create a derived property which evaluates your conditions and results in a True/False condition to be used for the validation.  In our implementation we use a property that is only accessible to system admins which specifies whether deletion is allowed and defaults to False, so a node cannot be deleted without an admin override.

  • CS3: Treeview Node Icon

    Hi all,
    I want to add Icon to treeview node.
    I have one folder, i want to list items  in treeview with ICONS.
    I tried with
    ::SHGetFileInfo(ucPath.GrabTString(), 0,&info, sizeof(info), SHGFI_ICON | SHGFI_SMALLICON | SHGFI_SHELLICONSIZE | SHGFI_TYPENAME | SHGFI_DISPLAYNAME )
    iconView->SetRsrcID((RsrcID) info.iIcon);
    but it is not working.
    Please help,
    Thanks,
    Vikram

    Put your icons in your resource file (in windows it is .rc file) and get it from there.

  • RAC - Node deletion process, how will olsnodes get updated?

    We had a two node rac on 10gR2 with ASM. Second node has been deleted.
    cluvfy comp crs -n <Node names> shows crs is not installed on second node. That is correct.
    But /u02/app/oracle/product/102/crs/bin/olsnodes -n shows both the nodes still.
    bash-2.03$ ./olsnodes -n
    node1 1
    node2 2
    What steps are to be followed to update it?

    Wanted to post a follow up in case any others are interested in the results...
    I had tried to add the listener back to one of the remaining nodes .ora file and then delete but that didn't work. Also, remove nodeapps continued to throw an error that it could not stop the listener or vip for the failed node.
    After a few days of reading I make a decision to just unregister the abandoned services from crs. I made sure to backup the OCRCONFIG before I ran crs_unregister and was able to successfully remove the listener and vip services from the failed node.
    This eliminated my issue with netca, the node did not show up there anymore. I then went on to remove nodeapps and it failed saying it could not find the resource vip. I then ran olsnodes -n and used crssetup to remove the node entirely. Everything showed removed and I went and updated the crs inventory to finish.
    All looks good and now I am working to rebuild and add the node back in.

  • When using numericupdown to expand/collapse treeView nodes. Why the collapse part is not working ?

    I have a treeView in my form1 designer. The treeView variable name is: treeViewMS1
    When i'm running my program the treeView is automatic expanded to level 1:
    Now if i click on the numericUpDown and change the value to 2 then:
    So the expanded part is working fine when i change of the numericUpDown by one up the expanded is working fine.
    Now when it's on level 2 and i change the numericUpDown back to value 1 that's level 1 instead get back to my first screenshot Expanded level 1 it's getting back to the root level 0.
    and i want that the collapse part will move only one level back but it dosen't matter if i'm on expanded level 2 or 3 or 5 it will allways jump to 0 to the root.
    This is the numericUpDown value changed event:
    decimal oldValue;
    private void numericUpDown1_ValueChanged(object sender, EventArgs e)
    if (numericUpDown1.Value > oldValue)
    ExpandToLevel(treeViewMS1.Nodes, (int)numericUpDown1.Value);
    else
    CollapseToLevel(treeViewMS1.Nodes, (int)numericUpDown1.Value);
    oldValue = numericUpDown1.Value;
    ExpandToLevel method:
    void ExpandToLevel(TreeNodeCollection nodes, int level)
    if (level > 0)
    foreach (TreeNode node in nodes)
    node.Expand();
    ExpandToLevel(node.Nodes, level -1);
    And CollapseToLevel method:
    void CollapseToLevel(TreeNodeCollection nodes, int level)
    if (level > 0)
    foreach (TreeNode node in nodes)
    node.Collapse();
    CollapseToLevel(node.Nodes, level - 1);

    I solved it this way:
    I solved it like this: In the Form1_Load event i did:
    SetToLevel(treeViewMS1.Nodes, 1);
    In my case i wanted it to begin by default in level 1.
    Then in the numericupdown1 changed value event:
    private void numericUpDown1_ValueChanged(object sender, EventArgs e)
    SetToLevel(treeViewMS1.Nodes, (int)numericUpDown1.Value);
    Then the method SetToLevel:
    void SetToLevel(TreeNodeCollection nodes, int level)
    foreach (TreeNode node in nodes)
    node.Collapse(false);
    ExpandToLevel(nodes, level);
    And last the method EXpandToLevel:
    void ExpandToLevel(TreeNodeCollection nodes, int level)
    if (level > 0)
    foreach (TreeNode node in nodes)
    node.Expand();
    ExpandToLevel(node.Nodes, level -1);
    And now it's working perfect like i wanted it to work. When changing the numericupdown value it's changing the node tree expand/collapse levels.

  • SMTP node deleted in SCOT

    Hello, SAP Help writes that SAP system creates SMTP node during the installation and we cannot deleted and created SMTP node.  I don't know why ocasionally  I was able to delete the SMTP host node in tr. SCOT .
    Nevertheless under INT in SCOT there is nothing.
    Now when I try to create SMTP node in SCOT the wizard offeres creating  RFC and HTTP node types only. It turns out that i can not create SMTP node at all.
    What can I do now? How to recreate SMTP node?

    Hi,
    Please click on this
    [http://help.sap.com/SAPHELP_NW04S/helpdata/en/2b/d9263f4b8a11d1894c0000e8323c4f/content.htm]
    i hope this will solve your problem
    Regards,
    Muralidhar

  • Context node deleted

    Hi Gurus,
    Am new to the Web UI developmoent.
    When i was working on the requirement of getting an existing view from a Zcomponent A to Zcomponent B ,
    the steps which i followed after going through many threads on sdn , was
    u2022Add View to Window: Open the Window node, find your window,
    right click on it and choose Add View.
    u2022Add Component Usage: Open the Component Usages node,
    right click on Component Usage and choose Add Interface View.
    u2022 Added the code in ' WD_USAGE_INITIALIZE ' method.
    No am facing 2 major issues :
    1) when i added the the view in the configuration part, it is throwing an exception which tells -
    Exception Class  CX_BSP_WD_INCORRECT_IMPLEMENT - There is no node text 'BTORDER' in controller ''. 
    Method:  CL_BSP_WD_CONTROLLER=>DO_CONTEXT_NODE_BINDING 
    Source Text Row:  39
    Initialization of view ZTOP_OPPORT/MyOpptResult of UI Component WCC_SLS_HOME failed
    An exception has occurred Exception Class  CX_BSP_WD_INCORRECT_IMPLEMENT - There is no node text 'BTORDER' in controller ''. 
    Method:  CL_BSP_WD_CONTROLLER=>DO_CONTEXT_NODE_BINDING 
    Source Text Row:  39
    Cannot display view WCC_SLS_HOME/SalesHome of UI Component WCC_SLS_HOME
    An exception has occurred Exception Class  CX_BSP_WD_INCORRECT_IMPLEMENT - There is no node text 'BTORDER' in controller ''. 
    Method:  CL_BSP_WD_CONTROLLER=>DO_CONTEXT_NODE_BINDING 
    Source Text Row:  39
    Window MainWindow of UI Component WCC_SLS_HOME cannot be displayed
    An exception has occurred Exception Class  CX_BSP_WD_RUNTIME_ERROR - View ZTOP_OPPORT/MyOpptResult in component WCC_SLS_HOME could not be bound 
    Method:  CL_BSP_WD_VIEW_CONTROLLER=>BIND_VIEW 
    2) secondly i tried re-creating the existing view which i added in the std Component B window.
    But when i deleted the view n created again it , now i see that the context node of that view in the z component is deleted.
    Deletion of the context node-  is it because i tried deleting the view in the window of the standard component which i added????
    Please let me how do i go about this..

    Hi seema rajjot
    Please check the CTXT class variables , there is a possibility of existing the context node that you created delete that entry manually from there.
    After deleting from there go to CREATE_CONTEXT_NODES method there you will see entry for context node class creation with name CREATE_YOUR CONTEXT NODE NAME, delete that entry manually.
    process to delete the component enhancement.
    Step 1
    First delete the View enahncement, select your view right click on it select delete, while deleting you must be bit catious a pop up will come with standard classes and Z classess there you have to select only Z classes.
    Step 2
    Once View enhancement is deleted delete the Component enahncement.
    if you created any Runtime repository entires or View configuration with your custom fields then first you have to delete those view and runtime repository configuration and then perform the above two steps
    Thanks & Regards
    Raj

  • [CS3] - TreeView node padding

    Hi all,    I'm creating TreeView which is used in my PlugIn instead of ListBox which is deprecated. Now is everything working fine, I have treeView without displayed root node. But my problem is that after adding new node some nodes are moved to the right about 10px.
    After pressing right arrow nodes are shifted to the left and nodes are in one vertical line.
    Please could you advise me how to force that nodes won't have any padding ?
    Thank you, marxin

    Check the bindings of tree node widgets.

  • Recover a Node deleted by option 2 in CCMS

    Hello,
    I deleted by mistake a node in CCMS by option number 2:
    2. You want to remove the selected nodes from the runtime environment,
    but keep the associated class properties for later use. The system
    deletes the nodes only if there are no more alerts for them,
    otherwise it marks the nodes for deletion.
    Now it is marked for deletion.
    How can i recover it back from deletion?
    Thanks for your help.

    Perform the restore steps as below:
    http://help.sap.com/saphelp_nw70/helpdata/en/fb/4fd43bcd48f112e10000000a114084/frameset.htm
    Restoring a Node in the Alert Monitoring Tree
    If you want to restore a node that you have deleted, follow the appropriate procedure below, depending on the deletion method that you used:
    You only deleted the node from the display (option 1)
    In this case, you only need to change the corresponding monitor definition again.
    You deleted the node in the runtime environment (options 2-4)
    In general, nodes that have been deleted from the shared memory are recreated and provided with values again, at the latest when the relevant application server is restarted. For nodes with passive data suppliers (the data collection methods), it is sufficient to execute the corresponding method. Follow the procedure below:
    Choose CCMS ® Configuration ® Alert Monitor, or call transaction RZ21.
    In the Topology group box, choose Segment Overview and choose Display Overview.
    The system displays the Monitoring: Display Technical Topology screen. Choose change mode with the Display « Change () pushbutton.
    Choose the segment that contains the node. If the deleted node is contained in a subtree of an application server, this is the segment with the name of the application server; otherwise, the segment is the central instance.
    Choose Reset Segment in "WARMUP" Status. This restarts all startup methods of this monitoring segment.
    You can find out whether a node is provided with data by passive or active data suppliers by choosing the Properties for the node. If an entry exists for Data Collection Method in the tab page Methods, the node is supplied with data by a passive data supplier.
    Thanks
    SM

  • TreeView nodes don't display

    While working my way through the IDCS3 SDK I'm about to implement a ListBox by using TreeView. I had a working plugin displaying a panel with some static text and two RollOverIcons. Then I compiled wlistboxcomposite from the SDK samples and it worked ok too.
    I then moved over all parts relevant for the listbox from the sample, adjusted widget names, boss name classes a.s.o, but I don't get it working. The whole panel is empty (grey background) with a greyed out scrollbar on the right border: the list entries are missing.
    I've looked through everything at least twice but don't see the reason for this. RefMeTreeViewAdapter populates the StringList ok and also DoAddItem() works as I can see from a InformationAlert I hacked in for debug reasons. Unfortunately I've no debug build for further investigations.
    But maybe someone of you has an idea what can cause this symptom.
    Regards,
    Juergen

    To resolve that issue. Another few hours later I discovered I missed adding LocaleIndex for the NodeWidget resource. After that it works.
    > You should never ship a plugin without testing it in the debug build.
    Thanks for the link. I somehow doubt Adobe will hand out a debug build to a hobby coder who's still in evaluation phase. But I'll think over it.
    Juergen

  • [CS3] TreeView Node Right click Contextual Menu

    Fellow Developers,
    Following is the code that I wrote in class FooPnlNodeEH : public CEventHandler to add a contextual menu. It doesnt work. Anybody has an insight what I might be doing wrong?
    bool16 FooNodeEH::RButtonDn(IEvent* e)
       do
             InterfacePtr<IApplication> theApp(gSession->QueryApplication());
             InterfacePtr<IActionManager> actionMgr(theApp->QueryActionManager());
             InterfacePtr<IMenuManager> menuMgr(actionMgr,UseDefaultIID());
             // get the coordinates based on the mouse location
             GSysPoint location = e->GlobalWhere();
             menuMgr->HandlePopupMenu(
                PMString("Do something", PMString::kEncodingASCII, PMString::kNoTranslate),
                location, location, kFalse, this);
          } while (kFalse);
       return kTrue;
    Thanks
    Jack

    This UI change is really stupid and useless. People got used to some specified menu items order. Changing this order could only annoy and anger.
    Also the reload button has been relocated. This is another example of stupid Firefox 4 UI change. The good news is that it could easily be relocated to its original place.
    It looks like the Firefox developers are suffering from idleness and boredom.
    CHANGE IT BACK ASAP!!!

  • How to move node in treeView using two buttons ?

    Hello ,
    Am starter , and am working on a Winforms application.
    I browse an XML file , then I populate treeview in my interface. I want to move selected node in the two sens ( up and down)  using two button ( so not with events , normal drag and drop with mouse ) .
    - I select the nod 
    - I click on the up button , then the node take the new place ( something like , drop and insert maybe )
    I don't know if is possible to affect this events to button or they are another way to do this 
    this is my code concerning populating treeView :
    private void browseSourceFileBtn_Click(object sender, EventArgs e)
    var openSourceFile = openSourceFileDialog.ShowDialog();
    if (openSourceFile == DialogResult.OK)
    fichierSourcePath.Text = openSourceFileDialog.FileName;
    // Connect the XML FILE DATABASE to the application interface
    private void button1_Click(object sender, EventArgs e)
    if (openSourceFileDialog.FileName == String.Empty)
    MessageBox.Show("u should open a file", "Erreur de chargement", MessageBoxButtons.OK, MessageBoxIcon.Error);
    else
    try
    MessageBox.Show("plz wait ");
    statusLabel.Text = "Début de chargement du fichier";
    var doc = new XmlDocument();
    doc.Load(openSourceFileDialog.FileName);
    sourceTreeView.Nodes.Clear();
    var rootNode = new TreeNode(doc.DocumentElement.Name);
    sourceTreeView.Nodes.Add(rootNode);
    sourceTreeView.CheckBoxes = true;
    sourceTreeView.AllowDrop = true;
    DateTime starteTime = DateTime.Now;
    BuildNode(doc.DocumentElement, rootNode);
    DateTime endTime = DateTime.Now;
    TimeSpan duree = endTime - starteTime;
    sourceTreeView.ExpandAll();
    sourceTreeView.Nodes[0].EnsureVisible();
    string chargementTemps = "" + duree.Minutes + "min : " + duree.Seconds + "s : " + duree.Milliseconds + "ms";
    statusLabel.Text = "Chargement effectué avec succés en :" + chargementTemps;
    catch (Exception)
    sourceTreeView.Nodes.Clear();
    statusLabel.Text = "Echec de chargement";
    thanks u a lot 

    Hi Nico68er,
    According to your description, you'd like to move up or down the node in TreeView.
    By reseraching, I found this post in StackOverFlow is similar with your issue.http://stackoverflow.com/questions/2203975/move-node-in-tree-up-or-down
    From this answer.
    You can use the following extensions
    public static class Extensions
    public static void MoveUp(this TreeNode node)
    TreeNode parent = node.Parent;
    TreeView view = node.TreeView;
    if (parent != null)
    int index = parent.Nodes.IndexOf(node);
    if (index > 0)
    parent.Nodes.RemoveAt(index);
    parent.Nodes.Insert(index - 1, node);
    else if (node.TreeView.Nodes.Contains(node)) //root node
    int index = view.Nodes.IndexOf(node);
    if (index > 0)
    view.Nodes.RemoveAt(index);
    view.Nodes.Insert(index - 1, node);
    public static void MoveDown(this TreeNode node)
    TreeNode parent = node.Parent;
    TreeView view = node.TreeView;
    if (parent != null)
    int index = parent.Nodes.IndexOf(node);
    if (index < parent.Nodes.Count -1)
    parent.Nodes.RemoveAt(index);
    parent.Nodes.Insert(index + 1, node);
    else if (view != null && view.Nodes.Contains(node)) //root node
    int index = view.Nodes.IndexOf(node);
    if (index < view.Nodes.Count - 1)
    view.Nodes.RemoveAt(index);
    view.Nodes.Insert(index + 1, node);
    Child nodes will follow their parents.
    You could use this class in your program.
    If you want to move the node up. Call the Extensions.MoveUp(this.treeView1.SelectNode)
    private void button1_Click(object sender, EventArgs e)
                if (this.treeView1.SelectedNode != null)
                    Extensions.MoveUp(this.treeView1.SelectedNode);
    If you have any other concern regarding this issue, please feel free to let me know.
    Best regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • I deleted nodes with the web developer and the deletion has become permanent. How to undo?

    I was trying to remove all the "Recommended Pages" etc. garbage on the right-hand side of Facebook and got a little click happy with 'delete nodes' using the Web Dev tools - as cathartic as it was! :)
    Now it seems as though I have broken FB on Firefox (seems to work fine on IE, surprisingly) as pics seem to be missing and the left-hand menu as well - but, of course the stuff I was trying to rid myself of comes back just fine ... sigh.
    I've read that all changes are supposed to be temporary until you restart the browser but this hasn't helped at all and I did try unchecking the 'Use hardware acceleration when available' that I read somewhere else, to no avail.
    Any assistance that can be rendered would be very much appreciated.
    For the record, I've learned my lesson and won't futz around with this anymore! :)

    For a node deletion in the Inspector tool,revert that by reloading the page. If that isn't working for you, you could try Command+Shift+r to reload the page bypassing the cache.
    You can check for problems with the sessionstore.js and sessionstore.bak files in the Firefox Profile Folder that store session data.
    Delete the sessionstore.js file and possible sessionstore-##.js files with a number and sessionstore.bak in the Firefox Profile Folder.
    HT > Profile Directory: Open Containing Folder
    http://kb.mozillazine.org/Profile_folder_-_Firefox
    Deleting sessionstore.js will cause App Tabs and Tab Groups and open and closed (undo) tabs to get lost, so you will have to create them again (make a note or bookmark them).
    http://kb.mozillazine.org/Multiple_profile_files_created

Maybe you are looking for

  • How to create-Form text field to simultaneously preview the text over an image

    I am trying to make a web page similar to the link below-where when a customer types in the form text field, and simultaneously, the text will preview in another area of the webpage over and image. See example when you create a label @ www.customwine

  • Portal favorites doesn't work after role change

    Dear all, we encounter the following problem in our EP: We have an WAD-Template stored in a folder. If a user is assigned to a specific portal role, he can see and execute the report. While executing he is allowed to store the report in his personal

  • What is used in CRM 2007

    hi  Experts, I need some clarifications regarding the CRM2007 UI Architecture. Is Webdynpro ABAP or BSP is avilable in CRM 2007 or both avialable in 2007? What is the UI stretegy in CRM2007? what is the Architecture of CRM2007? We are planning to upg

  • Best Practices for standardizing long text for EP GUI version

    Hello, I have a question that is related to standardizing best practices for all portal applications that use EP 1) The portal team has recommended activating the GUI version from portal to allow the long text to have the same features as the standar

  • Business Package ECC6.0 in EP7.0

    Hi there, is there any good implementationguide for BP ERP2005 that someone can mail me or give a link to download? Do we implement "federated Portal" to use this services? Best regards Christian