473,748 Members | 2,398 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TreeView or DataGridView ?

Hi,
I wish to display and edit 3 collections of different object types,
each object type also has a collection of the other 2 types,
such that if one object contains another then the reverse
is always true, a many to many relationship.

the objects are 3d objects making up a wire mesh model,
points,wire,sur faces.

im not sure wich is the best way to go,
it kind of needs a tree structure,
but it also has a datagrid type of structure too,
so is it a tree of grids or a grid of trees?

obviously the whole thing is totally recursive,
so the depth would be limited to something sensible like 3,
this kinda makes it more grid like.

The rest of the application ive done with
3d wireframe view/editing with XNA,
but im new to this sort of advanced control,
ive made my own tree/dir structure before,
but long long ago when the controls were rather limited,
(win3.1) lol.

have things move on much more?
Im trying to get to grips with the databinding,
but failing miserable, is it limited to text only data?
ive looked at a few tutorials and samples,
but its hard to see if they can be expanded,
can you have another datagrid inside another ?
maybe I should just make my own again.

for each item in the list I need to be able display the list of items in it,
preferably in another grid view below it wich is indented,
a bit like the visual ide does with data in the debuger but
wich doesnt stack up on top of each other or disapear when you move the
mouse away.

some objects have upto 4 3d vectors wich is 12 numbers
plus I need to be able to set some flags and highlight things etc.

Any helpfull ideas tutorials,examp les greatly appreciated :)

thanks
Colin =^.^=
Nov 30 '07 #1
4 4749
Colin,

It seems like you really want to have something like a combination of a
tree view control with a grid control, not one or the other.

You could get a third party grid which supports heiarchical data
displays, but I think there is a better alternative.

I suggest you use a TreeView in Windows Presentation Foundation, and
then use composition to display the extra bits of data for the items in the
tree.

As a matter of fact, the ATC Avalon team has a good sample:

http://blogs.msdn.com/atc_avalon_tea...01/541206.aspx

Which Chris Sells goes into further detail at:

http://www.sellsbrothers.com/news/sh...x?ixTopic=2128
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"colin" <co*********@nt world.NOSPAM.co mwrote in message
news:fO******** *****@newsfe1-gui.ntli.net...
Hi,
I wish to display and edit 3 collections of different object types,
each object type also has a collection of the other 2 types,
such that if one object contains another then the reverse
is always true, a many to many relationship.

the objects are 3d objects making up a wire mesh model,
points,wire,sur faces.

im not sure wich is the best way to go,
it kind of needs a tree structure,
but it also has a datagrid type of structure too,
so is it a tree of grids or a grid of trees?

obviously the whole thing is totally recursive,
so the depth would be limited to something sensible like 3,
this kinda makes it more grid like.

The rest of the application ive done with
3d wireframe view/editing with XNA,
but im new to this sort of advanced control,
ive made my own tree/dir structure before,
but long long ago when the controls were rather limited,
(win3.1) lol.

have things move on much more?
Im trying to get to grips with the databinding,
but failing miserable, is it limited to text only data?
ive looked at a few tutorials and samples,
but its hard to see if they can be expanded,
can you have another datagrid inside another ?
maybe I should just make my own again.

for each item in the list I need to be able display the list of items in
it,
preferably in another grid view below it wich is indented,
a bit like the visual ide does with data in the debuger but
wich doesnt stack up on top of each other or disapear when you move the
mouse away.

some objects have upto 4 3d vectors wich is 12 numbers
plus I need to be able to set some flags and highlight things etc.

Any helpfull ideas tutorials,examp les greatly appreciated :)

thanks
Colin =^.^=

Nov 30 '07 #2
On 2007-11-30 13:18:51 -0800, "colin" <co*********@nt world.NOSPAM.co msaid:
thanks,
im looking at those and its quite usefull information.
most of those ilustrations look like either trees or grids though.

it is much more than a tree, and the usefull depth of nesting is quite
limited,
but its also a bit more than a grid,
what I realy need is a grid with sub grids,
I haven't tried it, but it seems like you could use the
TableLayoutPane l, which has a grid-like paradigm, where you put a whole
TableLayoutPane l into a cell of another TableLayoutPane l.

As you say, you don't want to go too deep, otherwise you don't have
room to display everything. But that's an issue anyway.

Now, all that said, I'm wondering if this "nested grid" idea is really
the best way to display the data anyway. If it's for your own use, I
suppose you can do whatever UI you like best. But IMHO anything for
broader use needs to consider what's easy to use, and I'm not sure a
nested grid is an easily-understood concept, especially if there are
circular connections in multiple dimensions within the grid (as it
sounds as though there are).

I think that something more like an "inspector" UI would work better.
One possibility would be to allow arbitrarily many windows, each
representing a single object, to be open. Then you'd just double-click
on a reference within an object to open a new window showing you that
referenced object. Obviously you'd also have to have some way to show
the top-level collections. That could be a single window with a
TreeView containing three root nodes, one root for each type of object,
or one window for each type of object, or whatever.

Alternatively, you might just have three windows, one for each
collection. Within a window you would be able to expand a single
object to show its contents (so a TreeView or similar). But
double-clicking a referenced object of another type would select that
instance in the window corresponding to that type, rather than showing
the data in the owning object's window.

As a third alternative, if you feel that the relationships between the
objects really need to be shown in a more explicit, graphical way then
you might want to consider doing a custom control that actually
displays the graph of relationships in a visual way (nodes,
connections, etc.) Of course, there's not any .NET control I'm aware
of that supports this, so you'd have to implement it completely
yourself (or find a pre-made one that you can license). The previous
two suggestions could be done completely with just the built-in
functionality.

I will refrain from asking how you got to a point where you've got this
complex, circularly-referenced data structure. I've done 3D stuff
before, and I've never run into a situation where I needed that
complete a description of the relationships between my data. You might
want to think about whether a data structure that causes problem when
trying to represent it visually might not also cause problems later
down the road when trying to maintain the code.

I've seen a lot of complicated data structures, but I've found that the
most useful are often ones that can be easily visualized and are
relatively simple. That way, my brain doesn't have to work so hard
when I'm trying to figure out how to fit all the pieces together. :)

Pete

Nov 30 '07 #3
"Peter Duniho" <Np*********@Nn OwSlPiAnMk.comw rote in message
news:2007113014 092027544-NpOeStPeAdM@NnO wSlPiAnMkcom...
On 2007-11-30 13:18:51 -0800, "colin" <co*********@nt world.NOSPAM.co m>
said:
>thanks,
im looking at those and its quite usefull information.
most of those ilustrations look like either trees or grids though.

it is much more than a tree, and the usefull depth of nesting is quite
limited,
but its also a bit more than a grid,
what I realy need is a grid with sub grids,

I haven't tried it, but it seems like you could use the TableLayoutPane l,
which has a grid-like paradigm, where you put a whole TableLayoutPane l
into a cell of another TableLayoutPane l.
cool, if i was going to do it custom style this may be good basis.
As you say, you don't want to go too deep, otherwise you don't have room
to display everything. But that's an issue anyway.

Now, all that said, I'm wondering if this "nested grid" idea is really the
best way to display the data anyway. If it's for your own use, I suppose
you can do whatever UI you like best. But IMHO anything for broader use
needs to consider what's easy to use, and I'm not sure a nested grid is an
easily-understood concept, especially if there are circular connections in
multiple dimensions within the grid (as it sounds as though there are).
Yeah actually its not quite nested in a true sense, the 'nested' grid would
idealy
apear below the row wich is its parent, slightly indented to make it obvious
its a child.
as you say you wouldnt be able to fit much of a grid into one cell of
another grid.
the circular connections are just simply an easier way to find data,
as each object needs to know whats its connected to when it is modified.
the circular nature is probably not an issue especialy if the nesting depth
is limited to where it cant circle back to itself.
I think that something more like an "inspector" UI would work better. One
possibility would be to allow arbitrarily many windows, each representing
a single object, to be open. Then you'd just double-click on a reference
within an object to open a new window showing you that referenced object.
Obviously you'd also have to have some way to show the top-level
collections. That could be a single window with a TreeView containing
three root nodes, one root for each type of object, or one window for each
type of object, or whatever.
thats probably a lot easier way to implmenet it.
thats a bit like the data viewer in the visual IDE.

but it would be cool if the table opened up instead,
so one window didnt hide ita parent object
Alternatively, you might just have three windows, one for each collection.
Within a window you would be able to expand a single object to show its
contents (so a TreeView or similar). But double-clicking a referenced
object of another type would select that instance in the window
corresponding to that type, rather than showing the data in the owning
object's window.
I gues I would have three grid views anyway one for each collection.
as they need diferent colum headings.
thats an easy way to start with a flat view.
also I was looking at ways of making a space in the grid
open up by having a wide blank row wich was othewise invisible,
and just simply plonking the child grid right on top of it.
this might be an easy bodge.

it does however seem this is something thats easily done in asp,
I just wish it was implmented as easily on c# with windows forms and
controls.
As a third alternative, if you feel that the relationships between the
objects really need to be shown in a more explicit, graphical way then you
might want to consider doing a custom control that actually displays the
graph of relationships in a visual way (nodes, connections, etc.) Of
course, there's not any .NET control I'm aware of that supports this, so
you'd have to implement it completely yourself (or find a pre-made one
that you can license). The previous two suggestions could be done
completely with just the built-in functionality.
the model is already shown in full 3d, and can be editied by selecting with
mouse and draging,
so thats not realy an issue, its just if data needs to be fine tuned to get
rid of
stupid rounding errors or something, and also for looking to see whats gone
horribly wrong
somewhere not that I hope that ever happens.
I will refrain from asking how you got to a point where you've got this
complex, circularly-referenced data structure. I've done 3D stuff before,
and I've never run into a situation where I needed that complete a
description of the relationships between my data. You might want to think
about whether a data structure that causes problem when trying to
represent it visually might not also cause problems later down the road
when trying to maintain the code.
Ive probably over emphasized the complexity im not sure it needs more than 1
sub level
but a sub level depth of 1 would no easier to do than 2 or 3.

I might revisit the circular nature from that point of view,
it was otherwise a fair bit of efort to find out what each object is
connected to,
eg when moving each point of a surface to keep it coplaner
and also all adjoining surfaces coplaner too you need to know a fair bit
about
everything that is connected to it.
the same for when you try and move a single point or a wire.
it did however cuase 1 or 2 problems ensuring the connections were tied
together when inserting deleting
objects.
I've seen a lot of complicated data structures, but I've found that the
most useful are often ones that can be easily visualized and are
relatively simple. That way, my brain doesn't have to work so hard when
I'm trying to figure out how to fit all the pieces together. :)
theres just lots of numbers I want to make it easiest to navigate to the
right one.
im trying to make up for a lack of certain features in the available editor.

many thanks
Colin =^.^=
Nov 30 '07 #4
I think for now i'l use 3 flat grids on my form,
one will list the surfaces, the next will list wires
either in the whole model or in the selected surface.
the same for points.

maybe each list could select wether it showd all the object
in the model or just the ones connected to the one iof the selected objects
in the other list.

thatl probably do, would stil be nice to have drop down sub grids though ...

thanks for all the input :)

Colin =^.^=
"colin" <co*********@nt world.NOSPAM.co mwrote in message
news:fO******** *****@newsfe1-gui.ntli.net...
Hi,
I wish to display and edit 3 collections of different object types,
each object type also has a collection of the other 2 types,
such that if one object contains another then the reverse
is always true, a many to many relationship.

the objects are 3d objects making up a wire mesh model,
points,wire,sur faces.

im not sure wich is the best way to go,
it kind of needs a tree structure,
but it also has a datagrid type of structure too,
so is it a tree of grids or a grid of trees?

obviously the whole thing is totally recursive,
so the depth would be limited to something sensible like 3,
this kinda makes it more grid like.

The rest of the application ive done with
3d wireframe view/editing with XNA,
but im new to this sort of advanced control,
ive made my own tree/dir structure before,
but long long ago when the controls were rather limited,
(win3.1) lol.

have things move on much more?
Im trying to get to grips with the databinding,
but failing miserable, is it limited to text only data?
ive looked at a few tutorials and samples,
but its hard to see if they can be expanded,
can you have another datagrid inside another ?
maybe I should just make my own again.

for each item in the list I need to be able display the list of items in
it,
preferably in another grid view below it wich is indented,
a bit like the visual ide does with data in the debuger but
wich doesnt stack up on top of each other or disapear when you move the
mouse away.

some objects have upto 4 3d vectors wich is 12 numbers
plus I need to be able to set some flags and highlight things etc.

Any helpfull ideas tutorials,examp les greatly appreciated :)

thanks
Colin =^.^=

Dec 1 '07 #5

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

Similar topics

2
4242
by: osmarjunior | last post by:
Hello, I wanna create a control like a TreeView, but with some nodes with a grid. Is this possible? I think about create a user control, but maybe there's an easier way, like using the TreeView component itself.
0
1710
by: Nodir Gulyamov | last post by:
Hello All, First of all thanks in advance to everyone who will try to help me. I have Form with TreeView control and DataGridView control. Each TreeNode has its own rows and due to I am placing rows to ArrayList and store it in tag of TreeNode like this: // dgv - DataGridView visible within whole class private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { dgv.Rows.Clear();
0
1486
by: dotnetnari | last post by:
hi, how to transfer the elements from datagridview to treeview? Thanks..
1
2482
by: dotnetnari | last post by:
hi, how to drag and drop element from datagridview to treeview? \ Thks....
3
2386
by: Radicaly2k | last post by:
I would like to know how can I take the nodes of a treeview and store them into a SQL Server table so I can then visualize them in a DataGridView. Also I would like to store the information in a Xpath way. Thanks Christopher M. Contreras
0
7173
by: Dennis Francek | last post by:
Hello I have populated a treeview from my dataset and by clicking in the treeview i want to get the corresponding table shown in a datagridview. Ive managed this by looking at each DataRow and child rows and added the nodes with a columnname from each datarow. At the same time i have put in a tag at each treenode with a filter string and the current table im looking at as a string to use for later so i can create a datatable and set a filter...
0
913
by: Jon86 | last post by:
Hello all, I am new to programming, I have one query,Is it possible to drag and drop child elements from tree view control to datagridview control in dotnet (VS2005).I am using windows application .If so can any one share the code please. Cheers Jon
3
5740
by: Andrus | last post by:
I have DataGridView in virtual mode containing 3500 rows. In code below, assigning to RowCount value to 3500 takes 8 seconds. CPU usage goes high at this time. Stepping by F11 into user code shows few celltemplate property getters and combobox/datecombo constructor calls without database access which does not take a lot of time. Debug output (below) shows lot of messages Stepping over non-user code. Running in release mode from...
0
1974
by: AKIAKI | last post by:
Hello. I wish TreeView & DataGridView were synchronized. (Same row is Selected and Selected Row is equal high ) I set DataGridView & TreeView on Split Container. When TreeView does not have Horizontal scroll and DataGridView has Horizontal scroll, The displayed number of items is different. please tell me Method of displaying horizontal scroll in Treeview.
0
8991
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9544
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
9324
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
9247
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
8243
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
6796
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
6074
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
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2783
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.