title: Telerik MVC TreeView. How to expand all the nodes after ajax binding?
body: <p>TreeView gets populated through ajax and every item has <code>LoadOnDemand = true</code>. Now I need the tree to be fully expanded after binding. Calling <code>expand</code> on the client doesn't work because I guess <code>expand</code> doesn't support LoadOnDemand thing.</p>
  
  <pre><code>public ActionResult GetListOfDishes(TreeViewItem node)
          {
              var nodes = new List&lt;TreeViewItem&gt;();
  
              int dishId; int.TryParse(node.Value, out dishId);
  
              DataContext.GetDishes(dishId).ForEach(dish =&gt;
                  {
                      var d = new TreeViewItem
                      {
                          Text = dish.Name,
                          Value = dish.Id.ToString(),
                          LoadOnDemand = dish.IsGroup,
                      };
                      nodes.Add(d);
                  });
              return new JsonResult { Data = nodes };
          }
  
  
   @(Html.Telerik().TreeView()
          .Name("DishesTree")
           .DataBinding(dataBinding =&gt; dataBinding.Ajax().Enabled(true).Select("GetListOfDishes", "Dining"))
                  .ExpandAll(true)
  </code></pre>