6 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 12 Jan 2012, 03:26 PM
Hello Mirang,
I have tried reproducing the issue but no avail. Here is the code which fires Node_Click event on clicking the node's space rather than on clicking text.
Thanks,
Princy.
I have tried reproducing the issue but no avail. Here is the code which fires Node_Click event on clicking the node's space rather than on clicking text.
<
telerik:RadTreeView
ID
=
"RadTreeView1"
runat
=
"server"
CheckBoxes
=
"True"
Height
=
"280px"
OnNodeCheck
=
"RadTreeView1_NodeCheck"
onnodeclick
=
"RadTreeView1_NodeClick"
>
<
Nodes
>
<
telerik:RadTreeNode
Text
=
"Software"
Expanded
=
"true"
>
<
Nodes
>
<
telerik:RadTreeNode
Text
=
"Business & Office"
/>
</
Nodes
>
</
telerik:RadTreeNode
>
<
telerik:RadTreeNode
Text
=
"Books"
>
<
Nodes
>
<
telerik:RadTreeNode
Text
=
"Arts    "
/>
<
telerik:RadTreeNode
Text
=
"Biographies"
/>
</
Nodes
>
</
telerik:RadTreeNode
>
</
Nodes
>
</
telerik:RadTreeView
>
Thanks,
Princy.
0
mirang
Top achievements
Rank 1
answered on 13 Jan 2012, 04:49 AM
Hi Princy, Thanks for the reply.
Actually I have styled the radtreeview so that the entire node is highlighted, along with the text. By default only the text is highlighted on mouse over so the user can only click on that and it works fine. When I keep the entire node selected and the user click on some other part click does not fire. Any alternatives ?
Thanks
Mirang
Actually I have styled the radtreeview so that the entire node is highlighted, along with the text. By default only the text is highlighted on mouse over so the user can only click on that and it works fine. When I keep the entire node selected and the user click on some other part click does not fire. Any alternatives ?
Thanks
Mirang
0
Hello Mirang,
You can attach the following function to the TreeVIew's OnClientLoad event:
Regards,
Bozhidar
the Telerik team
You can attach the following function to the TreeVIew's OnClientLoad event:
function
clientLoad(sender){
$telerik.$(
'.rtTop, .rtMid, .rtBot'
).bind(
"click"
,
function
(e){
var
treeView = $find(
"RadTreeView1"
);
var
node = treeView._extractNodeFromDomElement(e.target);
node.select();
//If you want to expand and collapse the node on click, add this as well
//node.toggle();
});
}
Regards,
Bozhidar
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
mirang
Top achievements
Rank 1
answered on 13 Jan 2012, 10:25 AM
Thanks Bozhidar,
That did the trick, but the node.select(); doesnt fire the clientnodeclick event handler attached on the client side? Am I missing anything.
Regards,
Mirang
That did the trick, but the node.select(); doesnt fire the clientnodeclick event handler attached on the client side? Am I missing anything.
Regards,
Mirang
0
Accepted
Hello Mirang,
Please excuse me for misunderstanding you.
You can trigger the click with the following code:
Greetings,
Bozhidar
the Telerik team
Please excuse me for misunderstanding you.
You can trigger the click with the following code:
Sys.Application.add_load(
function
() {
$telerik.$(
'.rtTop, .rtMid, .rtBot'
).click(
function
(event) {
var
treeView = $find(
"RadTreeView1"
);
event.eventMapTarget = event.target;
treeView._click(event);
});
});
Greetings,
Bozhidar
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
mirang
Top achievements
Rank 1
answered on 21 Jan 2012, 12:23 PM
Thanks a lot. That worked perfectly.