title: kendo treeview mvc - error when clicking node
body: <p>I'm getting an error within the kendo.all.min.js when I try and click on one of the nodes in a TreeView - anyone know if I have to further configure it to avoid this?</p>
  
  <p>The error I'm getting is:</p>
  
  <pre><code>JavaScript runtime error: Unable to get property 'set' of undefined or null reference
  </code></pre>
  
  <p>and the rough area that is highlighted on error by VS is:</p>
  
  <pre><code>return arguments.length?(n=e(n,r).closest(q),r.find(".k-state-selected").each(function(){var e=i.dataItem(this);e.set("selected",!1),delete e.selected}),n.length&amp;&amp;i.dataItem(n).set("selected",!0)...
  </code></pre>
  
  <p>What i'm after is basically a list of files within a parent folder, and if the file is active and has child files, then I'd like it to give it a URL so they can open the link, but if not, I'd like nothing to happen, but I don't want to completely disable the node as I'd like the user to be able to expand it or shrink it if required.</p>
  
  <p>Here is the code I'm using for the treeview in MVC:</p>
  
  <pre><code>@(Html.Kendo().TreeView()
      .Name("treeview")
      .Items(level1 =&gt;
      {
          level1.Add().Text(rootFolderName)
          .SpriteCssClasses("folder")
          .Expanded(true)
          .Items(level2 =&gt;
          {
              int count = 0;
              foreach (var node in list)
              {
                  string title = node.Title;
                  string url = "";
                  if (node.HasChildren)
                  {
                      title = node.Title + "(" + node.ChildrenCount + ")";
                      url = "/Secure/Areas/Compliance.aspx?id=" + node.ItemId;
                  }
                  level2.Add().Text(title).Url(url)
                  .Expanded(true);
              }
          });
      })
  )
  </code></pre>
  
  <p>Anyone used these before and know what else I'm needing to do to achieve my aim?</p>