Click node text to expand/collapse instead of +/- icon in asp.net treeview

Advertisement
 On a treeview, we can collapse and expand the nodes by clicking the +/- icon. I want to be able to click
the node text to achieve the same results.

We can achieved by using node Id's dynamically and setting the selection node Expand statically.

For Dynamic Treeview, we can implement select action by using node id's.

Example:

   TreeNode.SelectAction = TreeNodeSelectAction.Expand;
 
   Listnode.SelectAction = TreeNodeSelectAction.Expand;


 For static Treeview, We can easily achieved by setting the "selectaction="Expand"" to the Treenode

Example:

<asp:TreeView ID="TVID" runat="server">

  <Nodes>

    <asp:TreeNode Text="Content" SelectAction="Expand">

        <asp:TreeNode Text="Main" SelectAction="Expand">
        
          <asp:TreeNode Text="SharePoint" SelectAction="Expand">
              <asp:TreeNode Text="SharePoint2013"/>
              <asp:TreeNode Text="SharePoint2010"/>
              <asp:TreeNode Text="SharePoint2007"/>
           </asp:TreeNode>

          <asp:TreeNode Text=".Net" SelectAction="Expand">
              <asp:TreeNode Text="4.0"/>
              <asp:TreeNode Text="3.5"/>
              <asp:TreeNode Text="3.0"/>
           </asp:TreeNode>

        </asp:TreeNode>

   </asp:TreeNode>

  </Nodes>

</asp:TreeNode>


By using JavaScript

http://geekswithblogs.net/rajiv/archive/2006/03/16/72575.aspx


SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM
Advertisements
SHARE

Lakshmi Tulasi Jasti

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

10 comments:

  1. This is additionally a fairly excellent post that individuals undoubtedly appreciated studying. Definitely not everyday which usually take pleasure in the odds to discover a merchandise.Click Here

    ReplyDelete
  2. I am impressed. I don't think Ive met anyone who knows as much about this subject as you do. You are truly well informed and very intelligent. You wrote something that people could understand and made the subject intriguing for everyone. Really, great blog you have got here. Text Marketing Autoresponder

    ReplyDelete
  3. Thanks for sharing the info, keep up the good work going.... I really enjoyed exploring your site. good resource..home depot survey

    ReplyDelete
  4. Hope you will keep on offering good content like this more often. I feel more and more people should know about this. Also, I agree on most of the points you have made.best charcoal grill india

    ReplyDelete
  5. Really I enjoy your site with effective and useful information. It is included very nice post with a lot of our resources.thanks for share. i enjoy this post. More information

    ReplyDelete
  6. A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. Visit her

    ReplyDelete
  7. This short description of CTFO gives you some idea of what the company does: ---
    Changing The Future Outcome also known as CTFO is a reputable (MLM) multi level marketing business in the CBD Oil niche. The primary reason behind their fast growth is that they provide some of the best CBD products in the marketplace. They also provide the products at a low cost for their associates and consumers. Considering that the CBD niche is growing faster and faster every year, it's easy to see why the CTFO network marketing company is growing so fast.CTFO Canada

    ReplyDelete
  8. Das Team von Versicherungsmakler Kassel verbindet diedigitalen Vorteile der Onlinewelt mit der persönlichen Beratung beim Kunden, so
    wie Sie es bis jetzt kennen in Kassel und der Umgebung.Für die Beratung werden sehr umfangreiche Softwareprogrammefür die Ausarbeitung der Ziele und Wünsche unserer Kunden eingesetzt. Diese
    Ausarbeitungen werden in persönlichen Beratungsterminen besprochen. Vorab
    werden die Wünsche und die Bedürfnisse der Kunden besprochen.Mit einer großen Auswahl von Berufsunfähigkeits Versicherungwerden Ihre individuelle Situation in der Beratung berücksichtigt. Sie können sich gegen mit Berufsunfähigkeit, der SchwerenKrankheiten Versicherung und gegen:Krebs, Schlaganfall, Demenz, Alzheimer, Multiple Sklerose Gutartiger Gehirntumor,
    Gutartiger Rückenmarkstumor, Herzinfarkt, Bypass-Operation am Herzen,
    Erkrankung des Herzmuskels (Kardiomyopathie), Herzstillstand, Operation zur
    Korrektur eines Herzfehlers, Ersatz oder Korrektur einer Herzklappe,
    Erkrankungen und Schädigungen des zentralen Nervensystems, Kinderlähmung /
    Polio absichern.Wir sind die Experten für die Schwere KrankheitenVersicherung in Kassel und der Umgebung. Das Team von Versicherungsmakler KasselEnglisch:The team ofinsurance brokers Kassel combines the digital advantages of the online world
    with personal advice to customers, as you know it up to now in Kassel and the
    surrounding area.For theconsultation very extensive software programs are used for the elaboration of
    the goals and wishes of our customers. These elaborations are discussed in
    personal consultation appointments.You can takeout insurance against occupational disability, serious illnesses and against:
    cancer, stroke, dementia, Alzheimer's, multiple sclerosis, benign brain tumor,
    benign spinal cord tumor, heart attack, bypass surgery on the heart, disease of
    the heart muscle (cardiomyopathy), cardiac arrest, surgery to correct a heart
    defect Secure, replace or correct a heart valve, diseases and damage to the
    central nervous system, polio.We are expertsin serious illness insurance in Kassel and the surrounding area.Schwere Krankheiten Versicherung Kassel

    ReplyDelete
  9. This High Temperature Aging Chamber is widely applied for automotive parts ,electronic and electric products ,components and materials by constant high temperature reliability test.High Temperature Aging Environmental Test Chamber

    ReplyDelete
  10. Such a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. click here

    ReplyDelete