473,545 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TreeView inside a ListView

29 New Member
How could I include a treeView inside a ListView?
Feb 7 '12 #1
4 6525
GaryTexmo
1,501 Recognized Expert Top Contributor
I'm not sure if you can do that with any built in .NET controls. You might want to look at using a custom control. I'm not entirely sure of what functionality you're looking for, but if it's the grid presentation with treeview functionality, the following article may be of use to you.

http://blogs.msdn.com/b/markrideout/...08/510700.aspx

I used this on a project in the past and with fairly minimal enhancement it worked quite well for me :)
Feb 7 '12 #2
Gobi nath
16 New Member
use treeview control on toolbox ,it will suit for u
Feb 9 '12 #3
mylixes
29 New Member
Thanks Gary for the reply. the link you shared helps me a lot. but I had encountered another problem using the expandable datagridView.

My datagrid consists of 4 columns, string column (treeView), combobox, linklabel and string column. Below is my code.

Expand|Select|Wrap|Line Numbers
  1. foreach (KeyValuePair<int, string[]> name in nameDictionary)
  2.             {
  3.                 parentNameNode = helper.getName(name.Value[i]);
  4.  
  5.                 //treeView1.Font = new Font(null, FontStyle.Bold);
  6.                 parentNode = rootNode.Nodes.Add(parentNameNode);
  7.                 parentNode.DefaultCellStyle.Font = new Font("Verdana", 7, FontStyle.Bold);
  8.  
  9.                 if (name.Value.Length > 1)
  10.                 {
  11.  
  12.                     for (int a = 0; a < name.Value.Length; a++)
  13.                     {
  14.  
  15.                         childNode = parentNode.Nodes.Add(readerName.Value[a], "aaaa", "Start");
  16.                         childNode.DefaultCellStyle.Font = new Font("Verdana", 7, FontStyle.Regular);
  17.  
  18.  
  19.                     }
  20.                 }
  21.  
Question:

How could I populate the comboBox column? I am getting this error "DataGridViewCo mboBoxCell value is not valid".

Please help me.
Mar 7 '12 #4
LittleDong
11 New Member

Question:

How could I populate the comboBox column? I am getting this error "DataGridViewCo mboBoxCell value is not valid".

Please help me.
comboBox.Items. Add(yourItemshe re)
is this useful?
Mar 7 '12 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1003
by: Helge Lenuweit | last post by:
Hello, I have an application that uses TreeView and ListView just like Windows Explorer or Outlook. You click on a tree node and the list is filled up with corresponding elements. My list results come from a (remoting) server, and processing is done in several layers. Now I would like to do this in a multithreaded scenario, i.e. fetching...
1
6030
by: Daisy | last post by:
I'm writing a NewsReader (seemed like a decent project to start learning with), and want threading like in OE. I've got a treeview and a listview. On Expand/Contract on the listview, I spin through the nodes checking .IsVisible, and those that are visible, I take the info I need (posted name / date) out of the .Tag (is there a better place...
1
1287
by: Mike | last post by:
Hi, Is there the possibility to have a ListView with a column that display items in a TreeView manner. How can I do that? Thanks. Mike
0
886
by: g1ga | last post by:
is there a way to drag icons (items) of a listview inside listview itself in a disordered way (like windows explorer)? I wondered why such a control is not implemented since it is one of the core components of windows itself.
6
9963
by: Beginner | last post by:
Hi, I'm trying to populate a TreeView from an existing and filled in ListView (lvwBuild). lvwBuild is a basic two column listview which can have any number of rows. I would like the first column of lvwBuild to be a node and the second column to be a branch on the TreeView (hopefully I have the syntax correct). I've been researching how...
2
1717
by: stacy | last post by:
I am attempting to port an application from a Windows app to an ASP.NET Web App. I notice that the TreeView and ListView controls are not part of the tool box on the WebForm. Can someone tell me if I can use these controls in the Web app. If I cannot, does anyone have a suggestion as to a similar control so I can avoid massive design and...
6
2632
by: Pucca | last post by:
My container with 2 panels containning Treeveiw and Listview controls are chopped off on the top by the toolstripmenu when I dock the these 2 contols in the parent container and the container is also docked to the parent, and the container at this poit enlarges and covers up the toolstripmenu. If I don't dock them then they don't resize when...
0
16275
debasisdas
by: debasisdas | last post by:
This sample code displays employee name in the treeview control from the emp table of Scott schema in oracle database. To start with Select Microsoft windows common controls 6.0 (SP6) from components Add a TreeView and a ListView control to the form. Add this sample code to the form ========================== Dim con As New...
3
10088
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hi misters, "And the link to Microsoft's site on that blog says: "The following ASP.NET controls are not compatible with partial-page updates, and are therefore not supported inside an UpdatePanel control: TreeView and Menu controls. ....
4
4883
by: fonix232 | last post by:
Hi there! I would like to ask for some help. I'm making a little application what is a modding tool, so in the main window it has a treeview and a detailed list view to show files what can be modded. But I just can't get around this, as I would need the treeview show all folders located under a given folder hierarchically, and the listview to...
0
7401
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7656
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7808
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
5972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5329
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3450
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3443
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1884
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
704
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.