This is a migrated thread and some comments may be shown as answers.

[Solved] how to call different action for binddata. urgent!!!

0 Answers 14 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
scott
Top achievements
Rank 1
scott asked on 16 Aug 2011, 03:37 PM
hello, everybody.
my database have 3 tables - store, category, items.
so i want to implement treeview to show them.
that is, when clicking root node, it will show(expand) child nodes for store.
and when clicking properly store item, it will show child nodes for category which has store_id fk, ...
----------------------------------------
Root
  -store1
      -category1
         -item1
         -item2
      -category2
........
-------------------------------------------
how can i implement for this treeview? i want to use client ajax databinding for this treeview.
my some source code is following...
<%= Html.Telerik().TreeView()
                .Name("TreeView")
                .BindTo(Model, (item, store) =>
                    {
                        item.Text = store.name;
                        item.Value = store.Id.ToString();
                        item.LoadOnDemand = store.category.Count > 0;
                    })
                .DataBinding(dataBinding => dataBinding
                    .Ajax().Select("_AjaxCategoryLoading", "MultiStore")
                )
        %>
----controller----
public ActionResult _AjaxCategoryLoading(TreeViewItem node)
        {
            ......
        }
public ActionResult _AjaxItemLoading(TreeViewItem node)
        {
            ......
        }
----------
at this point, when clicking category item, i cant access _AjaxItemLoading action.
can you show me how to implement this treeview?
any suggestion is welcome.
best regards.
scott
Tags
TreeView
Asked by
scott
Top achievements
Rank 1
Share this question
or