473,398 Members | 2,113 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,398 software developers and data experts.

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,surfaces.

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,examples greatly appreciated :)

thanks
Colin =^.^=
Nov 30 '07 #1
4 4727
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.com

"colin" <co*********@ntworld.NOSPAM.comwrote 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,surfaces.

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,examples greatly appreciated :)

thanks
Colin =^.^=

Nov 30 '07 #2
On 2007-11-30 13:18:51 -0800, "colin" <co*********@ntworld.NOSPAM.comsaid:
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
TableLayoutPanel, which has a grid-like paradigm, where you put a whole
TableLayoutPanel into a cell of another TableLayoutPanel.

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*********@NnOwSlPiAnMk.comwrote in message
news:2007113014092027544-NpOeStPeAdM@NnOwSlPiAnMkcom...
On 2007-11-30 13:18:51 -0800, "colin" <co*********@ntworld.NOSPAM.com>
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 TableLayoutPanel,
which has a grid-like paradigm, where you put a whole TableLayoutPanel
into a cell of another TableLayoutPanel.
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*********@ntworld.NOSPAM.comwrote 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,surfaces.

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,examples 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
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...
0
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...
0
by: dotnetnari | last post by:
hi, how to transfer the elements from datagridview to treeview? Thanks..
1
by: dotnetnari | last post by:
hi, how to drag and drop element from datagridview to treeview? \ Thks....
3
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...
0
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...
0
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...
3
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...
0
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...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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
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...

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.