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

[Solved] how to rebind treeview when combox change

0 Answers 26 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.
Bruce
Top achievements
Rank 1
Bruce asked on 16 Aug 2011, 09:57 AM
Hi
I put a combox and a treeview on the cshtml page, If changed the combox selectindex,I want to rebind the treeview by the new selectindex.
This page is ajax hopfully.  

@(Html.Telerik().ComboBox()
    .Name("cmbleft")
    .AutoFill(true)
    .SelectedIndex(0)
    .DataBinding(binding => binding.Ajax().Select("_AjaxcmbleftHMloading", "Station"))
    .HtmlAttributes(new { style = "width: 200px;" })
    .ClientEvents(events => events
    .OnChange("onComboBoxChange") )
    )

 @(Html.Telerik().TreeView()
    .Name("treeleft")
    .DataBinding(binding => binding.Ajax().Select("_Ajaxloading", "Station"))
    )

  <script type="text/javascript">
        function onComboBoxChange(e) {
            var treeView = $("#treeleft").data("tTreeView");
//how to rebind the   treeview datasource     
 //  treeView.reload();
            };        
      
    </script>

thanks for your help.

Tags
TreeView
Asked by
Bruce
Top achievements
Rank 1
Share this question
or