This is a migrated thread and some comments may be shown as answers.
RadTreeView events not firing
1 Answer 33 Views
This is a migrated thread and some comments may be shown as answers.
Rob Gaudet
Top achievements
Rank 1
Rob Gaudet asked on 19 Nov 2012, 08:02 PM
I cannot get the events to fire??? Thoughts?


SERVER SIDE
protected void rtvLyst_NodeClick(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e)
{
e.Node.Text = "NodeClick fired for this node";
}


CONTROL
<div class="lystList" style="display:none; min-width:100px; min-height:200px;">
<telerik:RadTreeView ID="rtvLyst" runat="server" OnClientNodeClicked="ClientNodeClicked" OnNodeClick="rtvLyst_NodeClick">

</telerik:RadTreeView>
</div>


CLIENT SIDE
function ClientNodeClicked(sender, eventArgs) {
var node = eventArgs.get_node();
alert("You clicked " + node.get_text());
}

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 20 Nov 2012, 05:19 AM
Hi Rob,

After inspecting your code, I have found you are setting the display of div as none. Once the div's visibility is set to block, I was able to make the events fire as expected. Here is the full code that I tried.
aspx:
<div class="lystList" id="div1" runat="server" style="display:none; min-width:100px; min-height:200px;">
 <telerik:RadTreeView ID="rtvLyst" runat="server" OnClientNodeClicked="ClientNodeClicked" OnNodeClick="rtvLyst_NodeClick">
  <Nodes>
  <telerik:RadTreeNode Text="node1">
  <Nodes>
    <telerik:RadTreeNode Text="child"></telerik:RadTreeNode>
  </Nodes>
  </telerik:RadTreeNode>
 </Nodes>
</telerik:RadTreeView>
</div>
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
C#:
protected void rtvLyst_NodeClick(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e)
{
  e.Node.Text = "NodeClick fired for this node";
}
protected void Button1_Click(object sender, EventArgs e)
{
 div1.Style.Add("display", "block;");
}
JS:
function ClientNodeClicked(sender, eventArgs)
{
  var node = eventArgs.get_node();
  alert("You clicked " + node.get_text());
}

Thanks,
Princy.
Asked by
Rob Gaudet
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Share this question
or