Treeview上下文菜单和完整路径 [英] Treeview Context Menu and Full path

查看:88
本文介绍了Treeview上下文菜单和完整路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我可以在客户端找到asp.net树视图的选定节点的完整路径吗?

我从数据集中绑定了这个树形视图,并在树形视图上填充了一个上下文菜单.但是我想在节点单击和上下文菜单上都显示完整路径(所有父节点的文本由一些分隔符分隔).

有什么办法吗?

请帮忙!

问候,
Snigdha

Hi All,

Can i find the full path of the selected node of a asp.net tree view on client side?

I am binding this treeview from dataset and populating a context menu on the treeview. But i want to show the full path(text of all parent nodes separated by some separator) both on node click and on context menu.

Is there any way around?

Please help!!

Regards,
Snigdha

推荐答案

大家好,

似乎没有人对此主题感兴趣.
无论如何,我有其他选择可以做到这一点.

当我们通过XML或数据集绑定树视图时,每个节点实际上都呈现为anchor(a)标记.

因此,您将获得一个在树状视图的"OnContextMenu"或"OnClick"上调用的客户端函数,并遵循以下代码.

Hi All,

Seems no body is interested in this topic.
Anyway I have got some alternative to do this.

When we bind treeview through XML or dataset, each node is actually rendered as an anchor(a) tag.

So you get a client side function called on "OnContextMenu" or "OnClick" of the treeview and follow this code.

var obj = window.event.srcElement;
var fullpath = obj.href();



在fullpath中,您可以获取所选节点的fullpath,并添加到一些其他信息中.您可以将其拆分并获取完整路径.在树状视图中,我没有为节点的URL字段提供任何路径.

就我而言,我是用'',''拆分它.

问候,
Snigdha:)



Here in fullpath, you can get your fullpath for the selected node, added to some extra information. You can just split it and get the full path. And in my treeview, I am not giving any path for the URL field of the nodes.

In my case, i am splitting it by '',''.

Regards,
Snigdha :)


这篇关于Treeview上下文菜单和完整路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆