473,394 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to Populate tree view object ???

Dear all,

I have the configuration part of my application which will
handle different element configuartion based on tree view
object similar as MMC and snap in.

Configuration data are retrive and save in a local
database for each component.

What is the best way to populate my tree view control.
Is there a easy way to map them to a dataset or XML file?

what is the best and simple.

thnaks for your reply
serge

Jul 21 '05 #1
1 4972
I'm doing it from a dataset, loading the XML file first.
(called DsEdit in this code snippet).
LcFilename as the name of an XML file.

'''''''''''''''''''''''''''''''''''''''''''''''''' '''''

' Create a FileStream object with the file path
and name.
Dim myFileStream As New System.IO.FileStream
(lcFilename, System.IO.FileMode.Open)
' Create a new XmlTextReader object with the
FileStream.
Dim myXmlTextReader As New System.Xml.XmlTextReader
(myFileStream)
' Read the data into the DataSet and close the
reader.
DsEdit.ReadXml(myXmlTextReader)
myXmlTextReader.Close()

TreeView1.Nodes.Clear()
Dim t As DataTable
Dim r As DataRow
Dim c As DataColumn
For Each t In DsEdit.Tables
Dim Tablenode As New TreeNode(t.TableName)
TreeView1.Nodes.Add(Tablenode)
Tablenode.ImageIndex = 0
Tablenode.SelectedImageIndex = 1
Dim FieldNode As TreeNode
For Each c In t.Columns
FieldNode = Tablenode.Nodes.Add
(c.ColumnName)
FieldNode.ImageIndex = 2
FieldNode.SelectedImageIndex = 2
FieldNode.Tag = Tablenode.Text
Next
Next
c = Nothing
r = Nothing
t = Nothing

'''''''''''''''''''''''''''''''''
Good luck
Moose
-----Original Message-----
Dear all,

I have the configuration part of my application which willhandle different element configuartion based on tree view
object similar as MMC and snap in.

Configuration data are retrive and save in a local
database for each component.

What is the best way to populate my tree view control.
Is there a easy way to map them to a dataset or XML file?

what is the best and simple.

thnaks for your reply
serge

.

Jul 21 '05 #2

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

Similar topics

0
by: Tree menu using XML | last post by:
I have one XML file that has nodes and sub node and each and every node has the attribute call visible if its value is true then diplay this node else don't display thid node, but this condition i...
1
by: RickDee | last post by:
Let me explain what I would like to do. I have created my own object which is able to execute or do something. Now I created a few instances of that object and put them in the tree view. There...
3
by: Saradhi | last post by:
Hi All, Here I am facing a performance problem with the TreeView Node renaming. I am displaying a hierarchy Data in a treeview in my Windows C# Application. My tree view represents an...
4
by: Mike | last post by:
how can i populate a treeview from a database? websites with examples would help.
1
by: serge calderara | last post by:
Dear all, I have the configuration part of my application which will handle different element configuartion based on tree view object similar as MMC and snap in. Configuration data are...
5
by: Pavan | last post by:
My goal is to accomplish the tooltip functionality for all the neodes in a tree view and i have the following three Events in my C# application. Name of my TreeView Control (AITreeView) 1)...
3
by: aine_canby | last post by:
I have a class which has a member which takes a long time to populate. Some of this member is serialised with an xml file, and some is established through a set of commands issued on the system....
1
by: jakki | last post by:
hi every one.. i am binding data in a tree view using windows C# .. auctually i finished most of the code.. but i did't know how to proceed further .. i attached the code hear.. as well as...
0
by: HarXon | last post by:
Hi, I am relatively new to C# and am attempting to implement the following: I currently have a text file containing the full path of all folders on a disk, from this i would like to create a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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...
0
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...

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.