This question is locked. New answers and comments are not allowed.
I am using a TreeView with checkbox support. But, I can nor find out how to get the value of the child items. When I click a parent item, all child items is checked, and when I uncheck the parent item all child items is unchecked. This is working the way it should, but I can only find the value of the parent item, not each checked or unchecked child items. This is my code:
@(Html.Telerik().TreeView() .Name("rtvTreeView") .ShowCheckBox(true) .ClientEvents(events => events .OnChecked("TreeView_onChecked") ) .BindTo(Model.Parentgroup, mappings => { mappings.For<Parentgroup>(binding => binding .ItemDataBound((item, group) => { item.Value = group.Id.ToString(); item.Text = group.Name; }) .Children(group => group.Childgroup)); mappings.For<Childgroup>(binding => binding .ItemDataBound((item, type) => { item.Value = type.Id.ToString(); item.Text = type.Name; })); }) )<script type="text/javascript"> function treeView() { return $('#rtvTreeView').data('tTreeView'); } function TreeView_onChecked(e) { var item = $(e.item); var isChecked = e.checked; var childCheckBoxes = item.find(":checkbox"); $.each(childCheckBoxes, function (index, checkbox) { $(checkbox).attr('checked', isChecked); var val = treeView().getItemValue(e.item); alert(val); treeView().nodeCheck(null, checkbox); }); }</script>