{"id":4763,"date":"2013-04-03T07:00:00","date_gmt":"2013-04-03T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2013\/04\/03\/how-can-i-move-an-htreeitem-to-a-new-parent\/"},"modified":"2013-04-03T07:00:00","modified_gmt":"2013-04-03T07:00:00","slug":"how-can-i-move-an-htreeitem-to-a-new-parent","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20130403-00\/?p=4763","title":{"rendered":"How can I move an HTREEITEM to a new parent?"},"content":{"rendered":"<p>Suppose you have a TreeView control, and you created an item in it, and you want to move the <code>HTREEITEM<\/code> to a new parent. How do you do that?<\/p>\n<p> You can&#8217;t, at least not all in one motion. <\/p>\n<p> You will have to delete the <code>HTREEITEM<\/code> and then re-create it in its new location. <\/p>\n<p> If you want to move an <code>HTREEITEM<\/code> within the same parent (say, to reorder it among its siblings), then you can use <a href=\"http:\/\/msdn.microsoft.com\/library\/bb773785.aspx\"> <code>Tree&shy;View_Sort&shy;Children&shy;CB<\/code><\/a> and pass a custom sort function that rearranges the children into the order you want. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Suppose you have a TreeView control, and you created an item in it, and you want to move the HTREEITEM to a new parent. How do you do that? You can&#8217;t, at least not all in one motion. You will have to delete the HTREEITEM and then re-create it in its new location. If you [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-4763","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>Suppose you have a TreeView control, and you created an item in it, and you want to move the HTREEITEM to a new parent. How do you do that? You can&#8217;t, at least not all in one motion. You will have to delete the HTREEITEM and then re-create it in its new location. If you [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/4763","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=4763"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/4763\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=4763"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=4763"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=4763"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}