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

[Solved] BeforeClientClick not firing

2 Answers 123 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Sharbel Lutfallah
Top achievements
Rank 1
Sharbel Lutfallah asked on 12 Feb 2008, 02:28 AM
Hi there,

I have a RadTreeView inside a user control with a custom skin.  The base behavior is to expand the nodes on a double click, but I want it to be on a single click to expand, so i followed this help item at : http://www.telerik.com/help/radcontrols/prometheus/tree_expand_onsingleclick.html but it doesnt seem like the BeforeClientClick event is firing.  Here is my markup: 

<%

@ Control Language="C#" AutoEventWireup="true" CodeBehind="MainMenu.ascx.cs" Inherits="website.MainMenu" %>

<%

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<

script type="text/javascript" language="javascript">

function ClickHandler(node)

{

if(node.Nodes.length > 0)

{

node.Toggle();

}

}

</

script>

<div id="sidenav">

<div class="sidetop"></div>

<telerik:RadTreeView ID="RadTVTestMenu" runat="server" onnodedatabound="RadTVTestMenu_NodeDataBound" Skin="wired" EnableEmbeddedSkins="false" BeforeClientClick="ClickHandler">

<CollapseAnimation Type="OutQuint" Duration="100"></CollapseAnimation>

<ExpandAnimation Type="OutQuart" Duration="100"></ExpandAnimation>

</telerik:RadTreeView>

<div class="sidebottom"></div>

</

div>

2 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 13 Feb 2008, 04:35 PM
Hello Sharbel Lutfallah,

Actually, this article is obsolete. It is not going to exist in the Prometheus help of Q3 SP2 release due by the end of the month. The help will be entirely updated.

With RadTreeView Prometheus you have to use the OnClientNodeClicking event, like:

function OnClientNodeClicking(sender, args)
{
     var node = args.get_node();
     if(node.get_nodes().get_count()>0)
       node.toggle();
}

For more details please refer to the following articles:
Client-side changes
Changes in the The RadTreeView class
Changes in the RadTreeNode class
The RadTreeView client object
The RadTreeNode client object

Hope these help.




Kind regards,
Nick
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Sharbel Lutfallah
Top achievements
Rank 1
answered on 13 Feb 2008, 09:49 PM
That worked perfectly, thank-you!
Tags
TreeView
Asked by
Sharbel Lutfallah
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Sharbel Lutfallah
Top achievements
Rank 1
Share this question
or