Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Mouse click in Treeview control(ASP.net server control)

Mouse click in Treeview control(ASP.net server control)

Scheduled Pinned Locked Moved ASP.NET
questioncsharpasp-netsysadmin
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SysJey
    wrote on last edited by
    #1

    I would like to perform mouse click(right / single / double ) in a every node of an treeview control. But no such event is avail for this control. How can i perform this operation ?.

    Jey

    M 1 Reply Last reply
    0
    • S SysJey

      I would like to perform mouse click(right / single / double ) in a every node of an treeview control. But no such event is avail for this control. How can i perform this operation ?.

      Jey

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      Hi there, In this case, you can customise the TreeView control to do what you want. You can create a custom TreeNode as below and override the RenderPreText/RenderPostText method:

      public class ExTreeNode : TreeNode
      {
      protected override void RenderPreText(HtmlTextWriter writer)
      {
      base.RenderPreText(writer);
      writer.AddAttribute("onmouseover", "alert('hover me')");
      }
      }

      Also, to make the TreeView control work properly on postback, you may need to create a custom TreeView control by inheriting the built-in control and override the protected CreateNode method.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups