.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Add custom popup menu to treeview

Posted By:      Posted Date: September 24, 2010    Points: 0   Category :SharePoint


I need to add a custom popup menu to a treeview.

The treeview is populated with a SharePoint site and displays all the lists from that specific site.

The treeview is something like this:

 |--+List Name 01
 |  |--+List01 Item 01
 |  |--+List01 Item 02
 |  |--+List01 Item 03
 |--+List Name 02
 |  |--+List02 Item 01
 |  |--+List02 Item 02
 |  |--+List02 Item 03

But i want to display that custom popup menu only when i right click on the list name (List Name 01, List Name 02.....).

If i right click on the root node or an item in the list i don't want to show the popup menu. Only if the selected node is a list.

Thank you very much for any info, code, help ...


View Complete Post

More Related Resource Links

Menu doesn't popup when WIndow style set to AllowsTransparency="True" WindowStyle="None"

Hi,I'm facing an issue, when using Window style set to AllowsTransparency="True" WindowStyle="None", my menus in menubar doesn't popup, rather they gets hidden (not visible) and if you just click by guess then menu item will be executed, its just that menu item is not shown visisble.However, if I revert back the Window style to normal without Transparency then menus visible(popup) perfectly.I'm not sure what could be an issue?San

asp:Menu submenu hover/expansion + HTTPS = Security Information Popup

Hello,I have a an asp:Menu with a datasource and the page is being accessed by https. If I hover over one of the menu items that has a subitem I get this popup.Here is my code,//asp <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="UI_Common_Test" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:Menu ID="Menu1" runat="server" DataSourceID="dsSiteMap" Orientation="Vertical" StaticDisplayLevels="2"> <DataBindings> <asp:MenuItemBinding DataMember="SiteMapNode" TextField="Title" /> </DataBindings> </asp:Menu> <asp:SiteMapDataSource ID="dsSiteMap" runat="server" SiteMapProvider="Public" /> </div> </form> </body> </html> //cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI;

How to add custom nodes for a treeview

Hi the actual procees of my work is initially i will have a root node for a treeview. If i right click on that i will have a context menu with some options. If i select add new from that i will add a text file as child node to the root node. This works fine . After adding that text file i would like to add a child node under that text file..   The over all flow will be Initially when page loads my treeview will be with a single rootnode   ACH If i add a text file i would like to show my treeview as follows   ACH |-> some.txt    |->A( Child for some.txt)        |->B(child for  A)             |->C(Child for B)   Up to A i was succeded but i do not know how to add the remaining also i would like to set image index for the custom child nodes added  

Creating a new document in Document Library from custom menu item (in the ECB)

Hello! I created a custom menu item in the ECB for a document library. I'd like for this to create a new document from this menu item. Additionally, I'd like to create a workflow where the Title of the document from which the menu action originates is inserted into a custom textfield in the new document that is created. Is this possible using SharePoint Designer?

Is it possible to disable context menu items based on the selection on Treeview

I will have some sort of nodes for a treeview as follows Root |-> some.txt(A text file which was added at runtime) |->Child(child for some.txt) |-> child1(child for child) I designed my context menu with some options as New and Remove What i need is when i righclick on Root, child or child i would like to disable the Remove option

How to make a TreeView custom ItemsSource behave like normal TreeViewItems?


I have made a custom class to populate a TreeView thru its ItemsSource. That class heritates ObservableCollection.

The thing is that its nodes doesnt seem to be TreeViewItems because i cant apply code that works for normal treeviewitems.

I'm talking about code to do right click select, etc.

Can somebody tell me how can i solve this problem?



How do I get a custom context menu to show up???

Okay, I just started back working on my web browser using Visual Basic 2K8, and I want to have my custom context menu show up when the user clicks inside the browser..... This is what I have...
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim Browser As New WebBrowser
        TabControl1.TabPages.Add("New Tab")
        Browser.Name = "Web Browser"
        Browser.Dock = DockStyle.Fill
        AddHandler Browser.ProgressChanged, AddressOf Loading
        AddHandler Browser.DocumentCompleted, AddressOf Done
        Int = Int + 1
        CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Navigate(UrlLocation.Text)
    End Sub

That is where I suspect the bit of code will have to go... Since I'm using Tab Control instead of the WebBrowser...

Is it possible to add a custom menu group to the Site Actions button?


I know I can use a Custom Action to add a new menu item to my Site Actions button .

Is it possible for me to add a new menu group to the Site Actions button? For example, like the OOB Site Settings menu group, which then extends out to offer additional items such as "Modify All Site Settings" etc.

TreeView with custom site map(security trimming enabled)


Hi all

I am really having tough time fixing this issue, Can anyone please guide me on this..

Here is my situation, I am developing a Portal having 2 xml sitemaps(one for visitors and one for registered users)

Web.sitemap (default) and Loggedin.sitemap(securitytrimming enabled)

I am binding sitemaps to Treeview.When i enable my security trimming  for loggedin.sitemap  i am having these issues.

1.Sitemappath is going blank 2.Selected Node color is not changing. 3.Selected node is not expanding.

 Here is th

how to show site action menu on custom master page??


i have created my own custom master page and trying to show "site action" menu on my master page

how is this posible,what modifications are needed in .master file  to do this

 in sharepoint 2010


How to hide/remove "Alert Me" action menu item from Custom List/Document Library?


Hi All,


I am using Sharepoint 2007 (MOSS).

I want to hide/remove "Alert Me" action menu item from Custom List/Document Library for my Sharepoint site.


any help will be appreciated.



Adding New Custom Folder Content Type doesn't show up on the Document Library New Menu


I been trying to add new custom folder content type to the document library programatically in my sandbox environment and it does show up on the document library. But, when I move same code to the almost similar configured SP2010 environment, adding new folder content type to the document library doesn't show up on the document library's new menu.

Here is the code? Since this code works fine in my sandbox environment, is there any other settings I should check on the server environment which would cause hiding content type on new menu of document library.

  class Program
    static void Main(string[] args)
      SPSite spSite = new SPSite("http://sp2010vm");
      foreach (SPWeb spWeb in spSite.AllWebs)
        spWeb.AllowUnsafeUpdates = true;

        //For each site, cycle through lists
        bool isDocLibraryExists = false;
	      foreach(SPList spList in spWeb.Lists)
          if(spList.Title == "Classified Documents")
             isDocLibraryExists = true; 
        if(isDocLibraryExists == true)
          //Create new doc library
          SPList splist = spWeb.Lists["Classified Documents"];

          //Create Content Type
          SPContentType documentContentType = spWeb.AvailableContentTypes["Classified Documents Folder"

How to make menus play Menu Popup sound

Programming in C# for .NET Framework 3.5:

I've noticed my Windows Forms menus (ToolStripMenuItems on a MenuStrip) do not make proper menu popup sounds when they open (a problem curiously shared by many flagship Microsoft applications, lately). How is this remedied? Is there just some flag I need to set somewhere? Or am I going to have to make a subclass of <some-ToolStrip*-class > and override <whatever-method-that-executes-when-menus-pop-up > so it properly makes sound? A bit of a daunting task for someone new to the language/library, however necessary.

If in fact the latter is necessary, any suggestions regarding the best class+method to override for the purpose?  Keeping in mind that I'd also like menu popup sounds for context menus, too.

Null values doesnot show up in custom edit form in a drop down choice menu


Hello guys,

I have a problem. I don't know why custom edit form is behaving like that.

I have a choice drop down with values  " ","Yes","No". For custom  new form, I can insert null values and everything is working fine.

But coming to this custom edit form which I created.  While editing, if we set a value to null and submit the form. It is getting the "Yes" as the value. It is skipping the null value and placing the "Yes" value. I have kept the default value for choice drop down as " ".(null too).

I don't know why it is not showing null value. Do guys have any idea or if came across anything like this. Please help

.Net custom user control buttons (events) not firing in Jquery Modal Popup


I have a custom control, that has takes some information from user and submit to the database. it is working fine in normal aspx pages. but when i display that custom user control in jQuery modal popup. The events does not fire or lets say the data is not submitted to the database.

any help on that?

TreeView - Popup Window


Hi there

I have got a treeview on my webpage.

All I want to do is : There shud be a pop - up window whenever I click a tree node.

 Can anyone please help me out.


Asif Ali.


SharePoint custom column not appearing in the add mapping popup


Have different Custom Columns created at various level:

  • Site Column
  • Doc. Lib
  • Content type

Added the above in document library.

The doc. lib is also populated with relevant data.

  1. created a content source for the Web App
  2. Did full crawl
  3. went to create managed property

But custom columns not appearing in the add mapping popup except the one used in Content Type?





ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend