How to refresh Treeview control
-
Hi, In my treeview control, I changed the indexes of the nodes. While debugging, I found indexes of the nodes are changed successfully. But the changes were not reflecting in the UI. Please let me know how to refresh the treeview. Thanks in advance..
-
Hi, In my treeview control, I changed the indexes of the nodes. While debugging, I found indexes of the nodes are changed successfully. But the changes were not reflecting in the UI. Please let me know how to refresh the treeview. Thanks in advance..
-
have you tried: treeview.Refresh(); or treview.Invalidate();
My opinion is... If someone has already posted an answer, dont post the SAME answer
ya, I tried both. They are not working.. I tried treeview.Update(), but in vain..
-
ya, I tried both. They are not working.. I tried treeview.Update(), but in vain..
are the nodes you change at the same level in the tree view. I have not tried changing the index before i can only think that maybe the index does not represent what you think it means? or maybe is there anything set that auto sorts the nodes? like aplhabetically or something?
My opinion is... If someone has already posted an answer, dont post the SAME answer
-
Hi, In my treeview control, I changed the indexes of the nodes. While debugging, I found indexes of the nodes are changed successfully. But the changes were not reflecting in the UI. Please let me know how to refresh the treeview. Thanks in advance..
AFAIK you cant change index of any node, its readonly property(Index). It would be better if you explain how did you change the indexes...
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can
-
AFAIK you cant change index of any node, its readonly property(Index). It would be better if you explain how did you change the indexes...
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can
Load again Tree.
-
Hi, In my treeview control, I changed the indexes of the nodes. While debugging, I found indexes of the nodes are changed successfully. But the changes were not reflecting in the UI. Please let me know how to refresh the treeview. Thanks in advance..
Are you using Remove and Insert to move the node? (I've never tried it, but suppose it should work.)
-
AFAIK you cant change index of any node, its readonly property(Index). It would be better if you explain how did you change the indexes...
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can
I used the following code to change the indexes. TreeNode Node0 = treeView2.Nodes[i - 1]; TreeNode Node1 = treeView2.Nodes[i]; foreach (TreeNode node in treeView1.Nodes[0].Nodes) { if (Node1.Text == node.Text) { m = node.Index; } if (Node0.Text == node.Text) { n = node.Index; } } if (m < n) { tempNode = Node1; Node1 = Node0; Node0 = tempNode; }
-
Are you using Remove and Insert to move the node? (I've never tried it, but suppose it should work.)
no, please look at the code which I posted now.