Cancel
Showing results for 
Search instead for 
Did you mean: 

Re-filling the Tree List table

Solution Partner Legend Solution Partner Legend
Solution Partner Legend

Hello everyone!

I'm trying to implement drag-n-drop in the Tree List table. It almost works, but I have an obstacle. I don't know what to do in order to update the table after I have dropped one node on top of the other. How to update the hierarchy of nodes that is altered as a result of the drag-n-drop action?

I have a method that fills the table based on the model data upon dialog creation. But I don't understand how to update in afterwards without initializing the dialog again.

Any advice is grealy appreciated!

4 REPLIES 4

Re: Re-filling the Tree List table

Solution Partner Genius Solution Partner Genius
Solution Partner Genius

Hello,

For the next command Operation List I used the delete and fill the treelist workaround.

    Function Delete_Tree_Nodes()
        Delete_Tree_Nodes = Nothing
        Try
            'delete all nodes from tree
            Dim theNode As BlockStyler.Node = Nothing
            Dim node As BlockStyler.Node = Nothing

            node = tree_control0.RootNode

            Do Until node Is Nothing
                theNode = node
                tree_control0.DeleteNode(theNode)
                node = tree_control0.RootNode
            Loop
        Catch ex As Exception

            '---- Enter your exception handling code here -----
            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)
        End Try
    End Function
Attila Szepesi, Application Engineer, graphIT Ltd.
Production: NX12.0.2 NX1863 | TcUA 11.3
Development: VB.NET, C# Testing: NX--

Re: Re-filling the Tree List table

Solution Partner Legend Solution Partner Legend
Solution Partner Legend

Thank you for the suggestion! I have eventually came to the similar solution - to delete the root nodes.

Node rootNode = app102_tree_control0.RootNode;
while(rootNode != null)
{
            app102_tree_control0.DeleteNode(rootNode);
            rootNode = app102_tree_control0.RootNode;
}

Re: Re-filling the Tree List table

Phenom
Phenom

Hi @aszepesi ,

It's off topic , I looked at your videos on youtube (good job , very impressive !!) your icons are great beautiful, how do you do it ? With what application work you?

Production: NX11.0.2.7,VERICUT 8.1.2
Development: Tcl/Tk, Gnuplot
www.adgroupe.com

Re: Re-filling the Tree List table

Solution Partner Genius Solution Partner Genius
Solution Partner Genius

Hi @mkn,

We use this website.

Attila Szepesi, Application Engineer, graphIT Ltd.
Production: NX12.0.2 NX1863 | TcUA 11.3
Development: VB.NET, C# Testing: NX--