473,473 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

TreeView samples

Anybody can shart some working samples of using that control on Windows
form?

Thanks
Nov 15 '05 #1
5 8102
I think MSDN Library should have some. If you are experiencing particular
problems with TreeView, please post them here, or, even better, in the
microsoft.public.dotnet.framework.windowsforms newsgroup.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Mark Goldin" <ma********@comcast.net> wrote in message
news:Oj**************@TK2MSFTNGP11.phx.gbl...
Anybody can shart some working samples of using that control on Windows
form?

Thanks


Nov 15 '05 #2
No I dont experience any PARTICULAR problem.
I am experiencing PROBLEM to get started in .NET.
Usually samples are very helpful.

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:Ok**************@TK2MSFTNGP09.phx.gbl...
I think MSDN Library should have some. If you are experiencing particular
problems with TreeView, please post them here, or, even better, in the
microsoft.public.dotnet.framework.windowsforms newsgroup.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Mark Goldin" <ma********@comcast.net> wrote in message
news:Oj**************@TK2MSFTNGP11.phx.gbl...
Anybody can shart some working samples of using that control on Windows
form?

Thanks

Nov 15 '05 #3
I see your point, Mark. Then MSDN examples are a good point to start, as
well as GotDotNet QuickStart tutorials (found at http://www.gotdotnet.com).

You can also look at the .NET 247 portal (http://www.dotnet247.com if I am
not mistaken).

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Mark Goldin" <ma********@comcast.net> wrote in message
news:eS**************@TK2MSFTNGP11.phx.gbl...
No I dont experience any PARTICULAR problem.
I am experiencing PROBLEM to get started in .NET.
Usually samples are very helpful.

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:Ok**************@TK2MSFTNGP09.phx.gbl...
I think MSDN Library should have some. If you are experiencing particular problems with TreeView, please post them here, or, even better, in the
microsoft.public.dotnet.framework.windowsforms newsgroup.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Mark Goldin" <ma********@comcast.net> wrote in message
news:Oj**************@TK2MSFTNGP11.phx.gbl...
Anybody can shart some working samples of using that control on Windows form?

Thanks



Nov 15 '05 #4
Thanks for help.
Would it be better idea to use third party component for
TreeView? The component that already has (or almost)
functionality I need?
-----Original Message-----
I see your point, Mark. Then MSDN examples are a good point to start, aswell as GotDotNet QuickStart tutorials (found at http://www.gotdotnet.com).
You can also look at the .NET 247 portal (http://www.dotnet247.com if I amnot mistaken).

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Mark Goldin" <ma********@comcast.net> wrote in message
news:eS**************@TK2MSFTNGP11.phx.gbl...
No I dont experience any PARTICULAR problem.
I am experiencing PROBLEM to get started in .NET.
Usually samples are very helpful.

"Dmitriy Lapshin [C# / .NET MVP]" <x-code@no-spam- please.hotpop.com> wrote
in message
news:Ok**************@TK2MSFTNGP09.phx.gbl...
> I think MSDN Library should have some. If you are experiencingparticular
> problems with TreeView, please post them here, or,
even better, in the > microsoft.public.dotnet.framework.windowsforms newsgroup. >
> --
> Dmitriy Lapshin [C# / .NET MVP]
> X-Unity Test Studio
> http://x-unity.miik.com.ua/teststudio.aspx
> Bring the power of unit testing to VS .NET IDE
>
> "Mark Goldin" <ma********@comcast.net> wrote in message > news:Oj**************@TK2MSFTNGP11.phx.gbl...
> > Anybody can shart some working samples of using
that control onWindows > > form?
> >
> > Thanks
> >
> >
>



.

Nov 15 '05 #5
The following Method fills a TreeView with the DataSet (and its Tables)
Strucure.
You mut call the Method with a reference to your exsisting TreeView
Control, DataSet to use and a String Array with Branch/Node Strings to use.
In my Projects these Strings are Language dependent and must be filled
beforhand.

OnFillTreeViewDataSet(ref TreeViewDataSet, ref dset_MainFrame, ref
sa_TreeViewDataSet);

Hope this helps as a starter.

Mark Johnson, Berlin Germany
mj*****@mj10777.de
private void OnFillTreeViewDataSet(ref TreeView ref_treeView, ref DataSet
dset_MainFrame, ref String[] sa_treeView)
{
string s_DataSet="",s_TableName="", s_FieldName="";
//---------------------------------------------------------------
string s_DataConnections="";
string s_AmountFields= "",s_AmountRows="",s_AmountTables="";
s_DataConnections = sa_treeView[1]; // "Data Connections";
s_AmountFields = sa_treeView[4]; // "Columns";
s_AmountRows = sa_treeView[5]; // "Rows";
if (dset_MainFrame.Tables.Count == 1)
s_AmountTables = sa_treeView[2]; // "Table";
else
s_AmountTables = sa_treeView[3]; // "Tables";
//---------------
// Display a wait cursor while the TreeNodes are being created.
Cursor.Current = Cursors.WaitCursor;
// Suppress repainting the TreeView until all the objects have been
created.
ref_treeView.BeginUpdate();
// Clear the TreeView each time the method is called.
ref_treeView.Nodes.Clear();
// Net.Framework.Compact does not support new TreeNode(s_DataSet,2,1);
// - thus we must do it per hand in 5 Steps instead of 1, but it should
work on both Systems
TreeNode tn_Node=null;
for (int i_DataSet=0;i_DataSet<1;i_DataSet++)
{
tn_Node = new TreeNode(); // Step 1 - only this
is possible the NET Framework.Compact
tn_Node.Text = s_DataConnections; // Step 2 - we really
don't need s_DataSet !
tn_Node.ImageIndex = 0; // Step 3 - Not
Selected - DataConnection.gif
tn_Node.SelectedImageIndex = 0; // Step 4 - Is
Selected - DataConnection.gif
ref_treeView.Nodes.Add(tn_Node);
if (dset_MainFrame.Namespace != sa_treeView[0])
{
s_DataSet = dset_MainFrame.Namespace;
tn_Node = new TreeNode();
tn_Node.Text = s_DataSet;
tn_Node.ImageIndex = 1; // Does this work ? -
DataBase_Closed.gif
tn_Node.SelectedImageIndex = 2; // Does this work ? -
DataBase_Open.gif
ref_treeView.Nodes[i_DataSet].Nodes.Add(tn_Node);
tn_Node = new TreeNode();
tn_Node.Text =
dset_MainFrame.Tables.Count.ToString()+" "+s_AmountTables;
tn_Node.ImageIndex = 8; // - NOTE12.ICO
tn_Node.SelectedImageIndex = 8; // - NOTE12.ICO
ref_treeView.Nodes[i_DataSet].Nodes[i_DataSet].Nodes.Add(tn_Node);
for(int i_Table=0;i_Table<dset_MainFrame.Tables.Count;i_Ta ble++)
{
DataTable dt_Table = dset_MainFrame.Tables[i_Table];
s_TableName = dt_Table.TableName;
tn_Node = new TreeNode();
tn_Node.Text = s_TableName;
tn_Node.ImageIndex = 6; // Does this work ?
tn_Node.SelectedImageIndex = 5; // Does this work ?

ref_treeView.Nodes[i_DataSet].Nodes[i_DataSet].Nodes[i_DataSet].Nodes.Add(tn
_Node);
tn_Node = new TreeNode();
tn_Node.Text = dt_Table.Columns.Count+"
"+s_AmountFields+", "+dt_Table.Rows.Count.ToString()+" "+s_AmountRows;
tn_Node.ImageIndex = 9; // - NOTE12.ICO
tn_Node.SelectedImageIndex = 9; // - NOTE12.ICO

ref_treeView.Nodes[i_DataSet].Nodes[i_DataSet].Nodes[i_DataSet].Nodes[i_Tabl
e].Nodes.Add(tn_Node);
for(int i_Fields=0;i_Fields<dt_Table.Columns.Count;i_Field s++)
{
s_FieldName = dt_Table.Columns[i_Fields].ColumnName; // May
not work > 0
tn_Node = new TreeNode();
tn_Node.Text = s_FieldName;
tn_Node.ImageIndex = 7; // Column.ico
tn_Node.SelectedImageIndex = 7; // Column.ico

ref_treeView.Nodes[i_DataSet].Nodes[i_DataSet].Nodes[i_DataSet].Nodes[i_Tabl
e].Nodes[i_DataSet].Nodes.Add(tn_Node);
tn_Node = new TreeNode();
tn_Node.Text =
dt_Table.Columns[i_Fields].DataType.ToString();
tn_Node.ImageIndex = 10; // - NOTE12.ICO
tn_Node.SelectedImageIndex = 10; // - NOTE12.ICO

ref_treeView.Nodes[i_DataSet].Nodes[i_DataSet].Nodes[i_DataSet].Nodes[i_Tabl
e].Nodes[i_DataSet].Nodes[i_Fields].Nodes.Add(tn_Node);
} // for(int i_Fields=0;i_Fields<dt_Table.Columns.Count;i_Field s++)
} // for(int i_Table=0;i_Table<dset_MainFrame.Tables.Count;i_Ta ble++)
} // if (dset_MainFrame.Namespace != sa_treeView[0])
} // for (int i_DataSet=0;i_DataSet<1;i_DataSet++)
// Open all the nodes
ref_treeView.ExpandAll();
// Begin repainting the TreeView.
ref_treeView.EndUpdate();
if (ref_treeView == TreeViewDataSet)
{ // this is TreeView and DataTable specific !
if (dtable_MainFrame00 != null)
i_MainFrame00SortCol = 0; // Rebuild ListView if Table is filled
} // if (treeViewDataSet == TreeViewDataSet)
// Reset the cursor to the default for all controls.
Cursor.Current = Cursors.Default;
//---------------
} // private void OnFillTreeViewDataSet(ref ref_treeView, ref
dset_MainFrame, ref sa_treeView)
#endregion


"Mark Goldin" <ma********@comcast.net> wrote in message
news:Oj**************@TK2MSFTNGP11.phx.gbl...
Anybody can shart some working samples of using that control on Windows
form?

Thanks

Nov 15 '05 #6

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

Similar topics

1
by: dave | last post by:
What is the most effecient method to take data from a database table (sqlserver) to a vb.net treeview control. The database table looks like ID, Name, ParenetID 1 , test, <null> 2, test2, 1...
4
by: meh | last post by:
I need to be able to persist a treeView to disk. I would like to save the node text, tag, image and selected image. I have done this using vb but I cant seem to translate from vb to vc#. Can ne1...
0
by: meh | last post by:
Still have not been able to convert this. More importently.....Is this sample going about it the right way??? tia meh Here is the vb code.........I keep looking at older vb.net projects to...
2
by: Trond Hoiberg | last post by:
Let say i have a bunch of files. Logfiles that is stored in subfolders. Folder1 --logfile1 --logfile2 --logfile3 Folder2 --logfile1 --logfile2 I want to display these files using data from...
2
by: Ernest Cook | last post by:
Does anyone have any real world experience using the .Net version of the treeview control? If so, Can you recommend any good documentation sources for learning more about it. i.e. Methods, etc. ...
1
by: Larry Pits | last post by:
Hi All, I tried to add a treeview control onto my windows Form and I set the name of the treeview to otree1 and id to oletreeview1. In the test.aspx.vb, I want to add nodes to the tree and I am...
1
by: cjinsocal581 | last post by:
Hi all, I am struggling with the following: Environement: VB.NET 2005 TreeView Control SQL Database I need to be able to save a TreeView's nodes into a SQL database and then be able to call...
4
by: Henry | last post by:
Does anybody have a real-world sample of buiding a treeview control using data from database tables? All the sample code I have found either builds the treeview manually or uses a file directory...
0
maliksleo
by: maliksleo | last post by:
hi i follow the following example http://quickstarts.asp.net/QuickStartv20/util/srcview.aspx?path=~/aspnet/samples/ctrlref/navigation/TreeView/TreeView10.src for treeview to populate ondemand....
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
1
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
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,...
1
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
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.