Click here to Skip to main content
15,937,198 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to show context menu strip on treenode of treeview.
I use the below ref. for generate context menu strip

I got two errors:
1. 'System.Web.UI.WebControls.TreeNode' does not have a public property named 'oncontextmenu'

Please help me.
Updated 15-Mar-11 21:51pm

1 solution

Since you have pasted 1 error, let me tell the reason for that.

As error states, it's clear that you don't have oncontextmenu 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 that oncontextmenu 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.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900