<%:
Html.Telerik().TreeView()
.Name("ZebTree")
.ExpandAll(false)
.ClientEvents(events => events.OnSelect("TreeView_onSelect"))
.BindTo(Model , map =>
{
map.For<TreeViewBind.Models.Category>(bind => bind.ItemDataBound((item, category) => { item.Text = category.CategoryName; }).Children(category => category.Products));
map.For<TreeViewBind.Models.Product>(bind => bind.ItemDataBound((item, product) => { item.Text = product.ProductName;}));
}
)
%>
上記は、telek mvc でツリーを生成するためのコードです。ノードを選択してアクションを実行したい。誰かが特定のノードをクリックすると、約ページに移動し、そのノードのテキストを引数として約ページに渡します。