{"id":87,"date":"2011-05-22T07:56:51","date_gmt":"2011-05-22T07:56:51","guid":{"rendered":"http:\/\/devnot.wordpress.com\/?p=87"},"modified":"2011-05-22T07:56:51","modified_gmt":"2011-05-22T07:56:51","slug":"find-out-whether-a-treeview-item-was-selected-by-the-user-and-how","status":"publish","type":"post","link":"https:\/\/thomas-jansen.eu\/?p=87","title":{"rendered":"Find out whether a treeview item was selected by the user (and how)"},"content":{"rendered":"<p>Some times it is useful to know whether a selection was made from code or by an user\u00a0 since the <em>AfterCheck<\/em> event of a <em>TreeView<\/em> control is fired after both.<\/p>\n<p>Use the code below to see how the selection was made:<\/p>\n<pre>private void tree1_AfterCheck(object sender, TreeViewEventArgs e)\n{\n   if (e.Action == TreeViewAction.ByKeyboard)\n   {\n      ..\n   }\n\n   if (e.Action == TreeViewAction.ByMouse)\n   {\n      ..\n   }\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Some times it is useful to know whether a selection was made from code or by an user\u00a0 since the AfterCheck event of a TreeView control is fired after both. Use the code below to see how the selection was made: private void tree1_AfterCheck(object sender, TreeViewEventArgs e) { if (e.Action == TreeViewAction.ByKeyboard) { .. } [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[43,81],"class_list":["post-87","post","type-post","status-publish","format-standard","hentry","category-c","tag-manually-clicked","tag-treeview"],"_links":{"self":[{"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=\/wp\/v2\/posts\/87","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=87"}],"version-history":[{"count":0,"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=\/wp\/v2\/posts\/87\/revisions"}],"wp:attachment":[{"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=87"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=87"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=87"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}