title: Showing context menu for kendo UI treewiew by condition
body: <p>I have a kendo UI treewiew, which represents some directory structure and context menu:</p>
  
  <pre><code> @(Html.Kendo().ContextMenu()
      .Name("menu")
      .Target("#treeview")
      .Orientation(ContextMenuOrientation.Horizontal)
      .Animation(animation =&gt; animation.Open(open =&gt;
      {
          open.Fade(FadeDirection.In);
          open.Duration(500);
      }))
      .Items(items =&gt;
      {
          items.Add()
              .Text("Test");
  
      })
      //.Events(e=&gt;e.Open("contextOpen"))
  )
  
  
  &lt;div class="treeview-back"&gt;
      @(Html.Kendo().TreeView()
          .Name("treeview")
          .TemplateId("treeview-template")
          .Checkboxes(checkboxes =&gt; checkboxes
              .Name("checkedFiles")
              .CheckChildren(true)
          )
          .Events(events =&gt; events
              .Check("onCheck")
          )
          .DataTextField("Name")
          .DataSource(dataSource =&gt; dataSource
          .Model(m =&gt; m.Id("Path").HasChildren("HasChildren"))
          .Read("ReadDirectory", "Download"))   
      )
  </code></pre>
  
  <p>I need to show context menu only for elements that represent folders. But I can't find the way to show kendo context menu by condition. I added right click capturing method, which looks like this:</p>
  
  <pre><code>$("#treeview").on('mousedown', '.k-item', function (event) {
              var treeView = $('#treeview').data('kendoTreeView');
              var dataSource = treeView.dataSource;
              var itemUId = $(this).attr("data-uid");
              var node = dataSource.getByUid(itemUId);
              if (event.which === 3 &amp;&amp; node.hasChildren) {
                  event.stopPropagation(); // to avoid propagation of this event to the root of the treeview
                  $('#treeview').data('kendoTreeView').select(this);
                  ...//here I should prevent context menu from showing somehow
              }
          });
  </code></pre>
  
  <p>but I can't find the way to cancel context menu showing. I also tried to add open event to context menu, but I can't get selected item there. 
  Thanks in advance.</p>