TreeView - data binding


About this example


The Bind method is used to bind the TreeView to the Model. Note that the MVC TreeView can only be bound to hierarchal data sources, and as such, a Model object passed to the Bind method must support the IHierarchicalEnumerable interface or IHierarchicalNodeProvider interface.

  • Bind(IHierarchicalEnumerable model, MapAction mapper);
  • Bind(HierarchicalNodeProviderBase dataProvider);
  • Bind(T root);
  • Bind(T root, Func dataBound);
  • Bind(string xmlUrl);
  • Bind(string xmlUrl, MapAction mapper);

This demo show use Norwind sample database and binding the TreeView to category and production data.