This question is locked. New answers and comments are not allowed.
I have a TreeView configured to load nodes on demand and use check boxes as shown:
I have on demand loading working. However, whenever I submit the form to my controller, I get a null List<TreeViewItem> instance. My controller signature looks like the following:
My own model comes across correctly but the list of nodes is null.
Using Fiddler I can see the checked nodes are being sent across. In addition to values from my model, I see values in the post data like:
SiteSelector_checkedNodes.Index=0
SiteSelector_checkedNodes%5B0%5D.Checked=true
...and so on for each checked node.
Any ideas?
@(Html.Telerik().TreeView() .Name("SiteSelector") .ShowCheckBox(true) .BindTo(new[] { Model }, (item, web) => { item.Text = web.Title; item.Value = web.Url; item.LoadOnDemand = web.HasSubWebs; }) .DataBinding(dataBinding => dataBinding.Ajax().Select("LoadSubSites", "Taxonomy")))[HttpPost]public ActionResult Create(TaxonomyCreateEditViewModel viewModel, List<TreeViewItem> checkedSites){ ...}Using Fiddler I can see the checked nodes are being sent across. In addition to values from my model, I see values in the post data like:
SiteSelector_checkedNodes.Index=0
SiteSelector_checkedNodes%5B0%5D.Checked=true
...and so on for each checked node.
Any ideas?