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

Treeview SelectedNode.Value

1 Answer 127 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
le N
Top achievements
Rank 1
le N asked on 11 Feb 2010, 02:11 PM
Hi,

i've got a problem using the RadTreeView.

I have a simple RadTreeview, which send some Javascript Arguments to a RadXmlHttpPanel using OnClientNodeClicked:

  function OnClientNodeClicked(sender, args) { 
 
             var node = args.get_node(); 
             node.select(); 
             var panel = $find("<%=RadXmlHttpPanel1.ClientID%>"); 
            
             panel.set_value(node.get_value()); 
             
 
             
 
         } 
 
  <telerik:RadXmlHttpPanel ID="RadXmlHttpPanel1" runat="server" 
                      Value="EMPTY" 
                      LoadingPanelID="RadAjaxLoadingPanel2" 
                        OnServiceRequest="XmlHttpPanel_ServiceRequest" 
                        Height="180px" 
                        Width="280px" 
                        EnableClientScriptEvaluation="true" 
                       ></telerik:RadXmlHttpPanel> 
 

It works well.

But i have to add another RadXmlHttpPanel under this one with a RadGrid inside (Following Telerik sample).

I put a OnNeedDataSource="RadGrid1_NeedDataSource" on my RadGrid in order to fill it, and i tried this in code behind:

Dim s As String = RadTreeView1.SelectedValue 
 RadGrid1.DataSource = MyFunction(s) 

But it fails. i've trying to find a solution for 2 days now, but i don't know how to catch my treeview value. Any help? thanks


Nicolas


1 Answer, 1 is accepted

Sort by
0
Pero
Telerik team
answered on 16 Feb 2010, 10:43 AM
Hello Nicolas,

The NeedDataSource server-side event will never be fired when the XmlHttpPanel's content is updated. The XmlHttpPanel uses client callback (or WebService) to update its content. This means that the page will not go through its full lifecycle - the server-side events of the controls will not be executed (in your example the NeedDataSource) and the ViewState will not be loaded/saved. The SelectedValue property of the RadTreeView1 will not have the "expected" value because the ViewState is not saved or loaded.

If you plan to use RadGrid in RadXmlHttpPanel you need to bind the grid in the XmlHttpPanel's ServiceRequest event, as can be seen from the following demo: http://demos.telerik.com/aspnet-ajax/xmlhttppanel/examples/gridinxmlhttppanel/defaultcs.aspx


Best wishes,
Pero
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
TreeView
Asked by
le N
Top achievements
Rank 1
Answers by
Pero
Telerik team
Share this question
or