Joshua Arend
Top achievements
Rank 1
Joshua Arend
asked on 08 Apr 2010, 06:11 PM
I had a Ajax Q1 2010 Tree working perfectly then decided to wrap it up in a RadPanelBar. I'm loading it server side and used " Dim treeview As RadTreeView = DirectCast(RadPanelBar1.FindItemByValue("templateHolder").FindControl("RadTreeView1"), RadTreeView)" to gain access to the control.
But...Node Click and Expand events are not firing.
Thanks,
But...Node Click and Expand events are not firing.
Thanks,
3 Answers, 1 is accepted
0
Hello Joshua Arend,
I've tested the scenario but wasn't able to reproduce this issue. Could you please send us some sample code which will help us? Thanks
Kind regards,
Yana
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.
I've tested the scenario but wasn't able to reproduce this issue. Could you please send us some sample code which will help us? Thanks
Kind regards,
Yana
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.
0
Joshua Arend
Top achievements
Rank 1
answered on 09 Apr 2010, 02:47 PM
Here's an excerpt of the code that I put into a test page. .aspx <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="OLD.aspx.vb" Inherits="OnlineAssessing.OLD" %> |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <html xmlns="http://www.w3.org/1999/xhtml" > | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <head runat="server"> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <title>Untitled Page</title> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </head> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <body> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <form id="form1" runat="server"> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <telerik:RadScriptManager ID="ScriptManager1" runat="server" ></telerik:RadScriptManager> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <telerik:RadPanelBar runat="server" ID="RadPanelBar1" Height="450px" ExpandMode="FullExpandedItem"> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Items> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <telerik:RadPanelItem Text="ParcelID" ImageUrl="Img/mail.gif" Expanded="True" runat="server"> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Items> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <telerik:RadPanelItem Value="templateHolder" runat="server"> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <ItemTemplate> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <telerik:RadTreeView id="RadTreeView1" AutoPostBack="True" runat="server" height="400" Width="210px" ></telerik:RadTreeView> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </ItemTemplate> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </telerik:RadPanelItem> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </Items> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </telerik:RadPanelItem> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </Items> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </telerik:RadPanelBar> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </form> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </body> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </html> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .vb
|
0
Hi Joshua,
Thank you for providing the code.
You should subscribe to the events in the definition of the treeview, because it's not accessible directly in the code-behind (it's inside a template):
and the event handlers:
also the nodes should be added only this first time the page loads:
I've attached the modified page for a reference.
Greetings,
Yana
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.
Thank you for providing the code.
You should subscribe to the events in the definition of the treeview, because it's not accessible directly in the code-behind (it's inside a template):
<telerik:RadTreeView ID="RadTreeView1" AutoPostBack="True" runat="server" Height="400" Width="210px" OnNodeExpand=" RadTreeView1_NodeExpand" OnNodeClick="RadTreeView1_NodeClick"></telerik:RadTreeView>and the event handlers:
Public Sub RadTreeView1_NodeClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTreeNodeEventArgs)End SubPublic Sub RadTreeView1_NodeExpand(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTreeNodeEventArgs)End Subalso the nodes should be added only this first time the page loads:
If Not Page.IsPostBack Then LoadRootNodes()End IfI've attached the modified page for a reference.
Greetings,
Yana
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.