473,795 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

treeview control continous...

I manage to fill treeview control with data and I would like to search
through that data.

In child I have names of films, and when I click on one of them I would like
to show it's information in grid.
How?

Hrcko
Nov 16 '05 #1
3 1366
In answer to your first question, you have to iterate your TreeNodes
recursively, such as

private TreeNode SearchNodes(str ing nodeName)
{
foreach(TreeNod e node in myTreeView.Node s)
{
if (string.Compare (nodeName, nodeText, true) == 0)
{
return node;
}
TreeNode foundNode = null;
foreach(TreeNod e childNode in node.Nodes)
{
foundNode = SearchNodes(nod eName);
if (foundNode != null)
{
return foundNode;
}
}
}
return null;
}
As for your second question, just handle the AfterSelect event of your
TreeView and then use the SelectedNode property to determine which node was
selected.

HTH,

DalePres
MCAD, MCDBA, MCSE
"Hrvoje Voda" <hr*********@lu atech.com> wrote in message
news:d1******** **@ls219.htnet. hr...
I manage to fill treeview control with data and I would like to search
through that data.

In child I have names of films, and when I click on one of them I would
like to show it's information in grid.
How?

Hrcko

Nov 16 '05 #2
What is nodeText in this function?

Hrcko
"DalePres" <don-t-spa-m-me@lea-ve-me-a-lone--.com> wrote in message
news:eW******** ******@TK2MSFTN GP10.phx.gbl...
In answer to your first question, you have to iterate your TreeNodes
recursively, such as

private TreeNode SearchNodes(str ing nodeName)
{
foreach(TreeNod e node in myTreeView.Node s)
{
if (string.Compare (nodeName, nodeText, true) == 0)
{
return node;
}
TreeNode foundNode = null;
foreach(TreeNod e childNode in node.Nodes)
{
foundNode = SearchNodes(nod eName);
if (foundNode != null)
{
return foundNode;
}
}
}
return null;
}
As for your second question, just handle the AfterSelect event of your
TreeView and then use the SelectedNode property to determine which node
was selected.

HTH,

DalePres
MCAD, MCDBA, MCSE
"Hrvoje Voda" <hr*********@lu atech.com> wrote in message
news:d1******** **@ls219.htnet. hr...
I manage to fill treeview control with data and I would like to search
through that data.

In child I have names of films, and when I click on one of them I would
like to show it's information in grid.
How?

Hrcko


Nov 16 '05 #3
A typo. It should read: node.Text

DalePres

"Hrvoje Voda" <hr*********@lu atech.com> wrote in message
news:d1******** *@ls219.htnet.h r...
What is nodeText in this function?

Hrcko
"DalePres" <don-t-spa-m-me@lea-ve-me-a-lone--.com> wrote in message
news:eW******** ******@TK2MSFTN GP10.phx.gbl...
In answer to your first question, you have to iterate your TreeNodes
recursively, such as

private TreeNode SearchNodes(str ing nodeName)
{
foreach(TreeNod e node in myTreeView.Node s)
{
if (string.Compare (nodeName, nodeText, true) == 0)
{
return node;
}
TreeNode foundNode = null;
foreach(TreeNod e childNode in node.Nodes)
{
foundNode = SearchNodes(nod eName);
if (foundNode != null)
{
return foundNode;
}
}
}
return null;
}
As for your second question, just handle the AfterSelect event of your
TreeView and then use the SelectedNode property to determine which node
was selected.

HTH,

DalePres
MCAD, MCDBA, MCSE
"Hrvoje Voda" <hr*********@lu atech.com> wrote in message
news:d1******** **@ls219.htnet. hr...
I manage to fill treeview control with data and I would like to search
through that data.

In child I have names of films, and when I click on one of them I would
like to show it's information in grid.
How?

Hrcko



Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1911
by: Thorsten Bast | last post by:
Hi, I'm sorry if this problem should have been sufficiently discussed here, but so far I could not find a satisfactory answer. I'm managing rental contracts with an access database and want to display timelines for records that each have a start- and enddate. right now I'm using a subform in tableview with 12 columns (one for each months) and have a query that throws out either a one or zero depending on the contract being active in that...
5
19891
by: SoKool | last post by:
Can anyone point me to a site where I can get a free treeview control to use in ASP .NET or any tutorial that can help me build my own treeview control. I intend to use a treeview to generate a dynamic menu by collating data from a Sql Server Table. Many thanks.
8
4411
by: Hrvoje Voda | last post by:
What is wrong in this code? private void tree_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { if (e.KeyCode == Keys.Enter ) {
3
2834
by: Peter | last post by:
Hello, We are inserting a side menu to our application using a class that is writing HTML on all our pages. This is a part of the code as an example: writer.Write(" <table WIDTH=""100%"" BORDER=""0"" CELLSPACING=""0"" CELLPADDING=""0"" ID=""Table1""> " & vbNewLine) writer.Write(" <tr>" & vbNewLine) writer.Write(" <td>" & vbNewLine)
4
14181
by: Ben Coats | last post by:
Hey, I'm trying to find code for an Explorer-style Directory ComboBox. (You know, it display "Desktop", "My Computer", all drives, etc., but it has a treeview control inside the combobox so that you can navigate through the file system as well.) I've found some on the web, but all of them just have the drives and desktop directories and are static in that you cannot expand the directories. I normally build a treeview control to do it with,...
10
2369
by: p3t3r | last post by:
I have a treeview sourced from a SiteMap. I want to use 2 different CSS styles for the root level nodes. The topmost root node should not have a top border, all the other root nodes should have a top border. Is it possible to have more than 1 style at the same level (parent node) when using a SiteMap? I want it to appear something like this and I can only find a way to either have the border on all root nodes or none at all. In...
1
2565
by: musosdev | last post by:
Hi guys I was using the Microsoft.Web.UI.WebControls extra namespace in my application to provide me with a TreeView control. I was using specifically ..GetNodeFromIndex(), SelectedNodeIndex and NodeData. All 3 of which are now giving errors is the new Asp.net TreeView. I'm found the Value property which replaces NodeData, but what about GetNodeFromIndex and SelectedNodeIndex. Are they just... gone!? :(
0
1998
by: noneya22 | last post by:
I want to use a TreeView control as a one-level, vertical navigation menu. I'm using this control currently with a SiteMapDataSource and .sitemap file. I've written code that associates an image with each TreeView node based upon a custom attribute I have included in the siteMapNode nodes of my .sitemap file. This all works as desired, including the security trimming which is especially desired behavior. The nodes of the TreeView...
0
12792
by: jiing | last post by:
Hi all, I want to use sting(the same as Node.Text) to judge if a node exists in TreeView. I've tried several ways, but seems all failed. could anybody help me? Thanks in advance. //My TreeView is defined to has depth =3 only.
0
10448
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10167
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9046
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7544
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6784
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5440
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4114
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
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.