带有上下文菜单条问题的treeview [英] treeview with context menu strip problem
本文介绍了带有上下文菜单条问题的treeview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在treeview的treenode上显示上下文菜单条.
我用下面的参考.用于生成上下文菜单条
http://dotnetslackers.com/articles/aspnet/ContextMenuOnTreeView.aspx
我遇到两个错误:
I want to show context menu strip on treenode of treeview.
I use the below ref. for generate context menu strip
http://dotnetslackers.com/articles/aspnet/ContextMenuOnTreeView.aspx
I got two errors:
1. ''System.Web.UI.WebControls.TreeNode'' does not have a public property named ''oncontextmenu''
请帮助我.
Please help me.
推荐答案
由于您粘贴了1个错误,因此请告诉我原因.
作为错误状态,很明显,节点上没有oncontextmenu
属性.要查看所有事件,请在此处 [ ^ ]
有关树视图控件的概述:此处 [
Since you have pasted 1 error, let me tell the reason for that.
As error states, it''s clear that you don''t haveoncontextmenu
proerty on nodes. To see all the events, look here[^]
For treeview control overview: here[^]
Now, why do you get an error. I just looked at the article you referred to and found that the author used a trick of embedding an html into the tree node text to have a context menu on client side. It looks like you are trying to use thatoncontextmenu
as a event of tree node (as per the error). As suggested in the article, follow the steps and embedd HTML in node-text instead of trying to use any node event.
这篇关于带有上下文菜单条问题的treeview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文