Discussion:
Creatively display Parent/Child
(too old to reply)
Rich Assaf
2008-10-18 00:59:10 UTC
Permalink
Hoping for any suggestions on this:

Standard Orders/LineItem tables, with parent/child relationship.

Normally, I would use 2 grids, parent grid above, child grid below.

In this case, I'd like to display them in the same control, like this:

John Smith OrderNumber OrderDate
LineItem 1 detail
LineItem 2 detail
Suzy Chapstick OrderNumber OrderDate
LineItem 1 detail
LineItem 2 detail
LineItem 3 detail


I haven't worked with TreeViews, would this work OK with small- or
medium-size tables (5k - 50k records)?

I'm also considering using SQL to build a combined table, then display
in a grid. Advantage is conditionally coloring the rows based on some
LineItem details (perhaps Treeviews can also be conditionally
formatted?). Problem is user needs to sort by OrderDate or OrderNumber,
either ascending or descending, and also quickly switch between showing
either all items or open items only ... and I'm not sure how I could
make the children follow the parent in a "hybrid grid"

There will usually be 1-4 LineItems, rarely more....

User needs to double-click on a lineitem and open a detail form to edit
certain fields, or double-click on a parent item and open a different
form to edit.

Anyone done anything like this???

Thanks, Rich
Geoff Wass [dBVIPS]
2008-10-18 05:51:23 UTC
Permalink
Post by Rich Assaf
Standard Orders/LineItem tables, with parent/child relationship.
Normally, I would use 2 grids, parent grid above, child grid below.
John Smith OrderNumber OrderDate
LineItem 1 detail
LineItem 2 detail
Suzy Chapstick OrderNumber OrderDate
LineItem 1 detail
LineItem 2 detail
LineItem 3 detail
I haven't worked with TreeViews, would this work OK with small- or
medium-size tables (5k - 50k records)?
I'm also considering using SQL to build a combined table, then display
in a grid. Advantage is conditionally coloring the rows based on some
LineItem details (perhaps Treeviews can also be conditionally
formatted?). Problem is user needs to sort by OrderDate or OrderNumber,
either ascending or descending, and also quickly switch between showing
either all items or open items only ... and I'm not sure how I could
make the children follow the parent in a "hybrid grid"
There will usually be 1-4 LineItems, rarely more....
User needs to double-click on a lineitem and open a detail form to edit
certain fields, or double-click on a parent item and open a different
form to edit.
Anyone done anything like this???
Thanks, Rich
Rich,

Another idea would be to fake it. Create a temporary table which has one
large text field. Fill it with text based on your existing two tables so
that the fields of the temporary table match your preferred layout.
Display that temporary table in a single grid. If you make your grid so
that the column has an editorType=Editor, then you text can contain
basic HTML tags which will allow you to achieve something more visually
appealing.
--
Geoff Wass [dBVIPS]
Montréal, Québec, Canada

.|.|.| dBASE info at http://geocities.com/geoff_wass |.|.|.
.|.|.| ---------------------------------------------------------- |.|.|.
.|.|.| IT Consultant http://Geoff_Wass.com |.|.|.
Rich Assaf
2008-10-19 19:17:05 UTC
Permalink
Post by Geoff Wass [dBVIPS]
Another idea would be to fake it. Create a temporary table which has one
large text field. Fill it with text based on your existing two tables so
that the fields of the temporary table match your preferred layout.
Display that temporary table in a single grid. If you make your grid so
that the column has an editorType=Editor, then you text can contain
basic HTML tags which will allow you to achieve something more visually
appealing.
Right, and the table would be in natural (created) order, just displayed
in the grid... that's the direction I'm most seriously considering...
The issue is when re-sorting, or limiting the parent rowset, to keep the
children records sorted and moved. That would probably require
completely rebuilding the table, and re-displaying the grid. Even
simple field edits might require a rebuild (or perhaps just update both
the temp table and the underlying table would work). Ultimately this
will also be a web app, so I'm trying to keep performance considerations
front and center....

Thanks for your thoughts, Rich
Geoff Wass [dBVIPS]
2008-10-20 04:37:33 UTC
Permalink
Post by Rich Assaf
Right, and the table would be in natural (created) order, just displayed
in the grid... that's the direction I'm most seriously considering...
The issue is when re-sorting, or limiting the parent rowset, to keep the
children records sorted and moved. That would probably require
completely rebuilding the table, and re-displaying the grid. Even
simple field edits might require a rebuild (or perhaps just update both
the temp table and the underlying table would work). Ultimately this
will also be a web app, so I'm trying to keep performance considerations
front and center....
Thanks for your thoughts, Rich
Rich,

You're welcome. It sounds like you have lots to think about.
--
Geoff Wass [dBVIPS]
Montréal, Québec, Canada

.|.|.| dBASE info at http://geocities.com/geoff_wass |.|.|.
.|.|.| ---------------------------------------------------------- |.|.|.
.|.|.| IT Consultant http://Geoff_Wass.com |.|.|.
Ken Mayer [dBVIPS]
2008-10-18 04:10:45 UTC
Permalink
Post by Rich Assaf
Standard Orders/LineItem tables, with parent/child relationship.
Normally, I would use 2 grids, parent grid above, child grid below.
John Smith OrderNumber OrderDate
LineItem 1 detail
LineItem 2 detail
Suzy Chapstick OrderNumber OrderDate
LineItem 1 detail
LineItem 2 detail
LineItem 3 detail
I haven't worked with TreeViews, would this work OK with small- or
medium-size tables (5k - 50k records)?
I'm also considering using SQL to build a combined table, then display
in a grid. Advantage is conditionally coloring the rows based on some
LineItem details (perhaps Treeviews can also be conditionally
formatted?). Problem is user needs to sort by OrderDate or OrderNumber,
either ascending or descending, and also quickly switch between showing
either all items or open items only ... and I'm not sure how I could
make the children follow the parent in a "hybrid grid"
There will usually be 1-4 LineItems, rarely more....
User needs to double-click on a lineitem and open a detail form to edit
certain fields, or double-click on a parent item and open a different
form to edit.
Anyone done anything like this???
There's Greg B's grid that can do this, but it's not easy to work with,
as he didn't assign properties in a way that match the dBASE properties,
and his documentation is not easy to read.

Details on where to get this are at my website (the dbase website noted
below), way toward the bottom ...

Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
http://www.goldenstag.net/dbase
Rich Assaf
2008-10-19 19:06:32 UTC
Permalink
In article <***@news-server>, ***@_nospam_goldenstag.net
says...
Post by Ken Mayer [dBVIPS]
There's Greg B's grid that can do this, but it's not easy to work with,
as he didn't assign properties in a way that match the dBASE properties,
and his documentation is not easy to read.
Details on where to get this are at my website (the dbase website noted
below), way toward the bottom ...
Ken
Thanks for the reminder Ken ... I do remember looking at Greg B's grid
years ago, and remember being very confused.... Are you aware of anyone
successfully adapting it?

Rich
Ken Mayer [dBVIPS]
2008-10-19 21:54:28 UTC
Permalink
Post by Rich Assaf
says...
Post by Ken Mayer [dBVIPS]
There's Greg B's grid that can do this, but it's not easy to work with,
as he didn't assign properties in a way that match the dBASE properties,
and his documentation is not easy to read.
Details on where to get this are at my website (the dbase website noted
below), way toward the bottom ...
Ken
Thanks for the reminder Ken ... I do remember looking at Greg B's grid
years ago, and remember being very confused.... Are you aware of anyone
successfully adapting it?
I did some stuff for Jan at one point, but it's not something I have
time to spend on right now ... It's doable. Look at his examples, for
starters. He doesn't explain some of what he's doing, but ...

Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
http://www.goldenstag.net/dbase
Jan Hoelterling
2008-10-20 12:53:11 UTC
Permalink
Rich,

the DBgrid is exactly for this kind of stuff. As Ken said, it's a bit
unwieldy at first, but it's got some great capabilities. For what you
describe, it would be perfect, IMHO.

Jan
Rich Assaf
2008-10-25 06:22:48 UTC
Permalink
Post by Jan Hoelterling
Rich,
the DBgrid is exactly for this kind of stuff. As Ken said, it's a bit
unwieldy at first, but it's got some great capabilities. For what you
describe, it would be perfect, IMHO.
Hi Jan,

As a follow-up, I have been working with dbGrid, and after a lot of
trial and error, am very pleased with the appearance and functionality
of this control. So thanks for YHO (Your Humble Opinion?) <G>

One thing I haven't figured out is how to programmatically "Collapse
All" and then "Expand All" of the grid - have you done this? In the
onOpen setup, one can adjust this property:

this.rowControl.expanded = true

If set to false, all the rows are collapsed when grid opens. But a
pushbutton event like this:

form.dbGrid.rowControl.expanded := false
form.dbGrid.refreshData()

doesn't seem to do anything.

Thanks, Rich
Greg Hill
2008-10-28 06:39:15 UTC
Permalink
Post by Rich Assaf
Post by Jan Hoelterling
Rich,
the DBgrid is exactly for this kind of stuff. As Ken said, it's a bit
unwieldy at first, but it's got some great capabilities. For what you
describe, it would be perfect, IMHO.
Hi Jan,
As a follow-up, I have been working with dbGrid, and after a lot of
trial and error, am very pleased with the appearance and functionality
of this control. So thanks for YHO (Your Humble Opinion?) <G>
One thing I haven't figured out is how to programmatically "Collapse
All" and then "Expand All" of the grid - have you done this? In the
this.rowControl.expanded = true
If set to false, all the rows are collapsed when grid opens. But a
form.dbGrid.rowControl.expanded := false
form.dbGrid.refreshData()
doesn't seem to do anything.
Is there a way you can re-assign the data?
You might try reinstating the whole grid, though that could be kind of
crude.

Greg Hill
Jan Hoelterling
2008-10-28 09:06:32 UTC
Permalink
Hi Rich,

sorry, am not sure right now how to do that either. It's been a while since
I last used it.

Jan
Rich Assaf
2008-10-30 02:41:37 UTC
Permalink
Post by Jan Hoelterling
Hi Rich,
sorry, am not sure right now how to do that either. It's been a while since
I last used it.
Hi Jan,

So far it seems pretty stable, still trying to work out a few minor
"kinks"....

My concern is ongoing stability with dbGrid if I deploy this app beyond
my immediate control....especially since the "magic" seems well-hidden
in the dll or other files. Still, it is amazingly powerful.... Did you
have any specific issues why you stopped using this grid?

Thanks, Rich

Greg Hill
2008-10-18 06:48:27 UTC
Permalink
Post by Rich Assaf
Standard Orders/LineItem tables, with parent/child relationship.
Normally, I would use 2 grids, parent grid above, child grid below.
John Smith OrderNumber OrderDate
LineItem 1 detail
LineItem 2 detail
Suzy Chapstick OrderNumber OrderDate
LineItem 1 detail
LineItem 2 detail
LineItem 3 detail
You could do it with Crystal Reports and Marc VDB's wrapper. With his
wrapper you can lauch a form when clicking on the surface of the crystal
report. I have a work version of it.
The sorting would require adding a sort button to the viewer.

One other way would be a lot of work but it could be done with a custom
control on a form. I use a custom control to display children rows that
only require a 3 columns. Its a lot of work to get everything working plus
its runs kind of slow when dynamically creating rows.

I think the temp table mentioned by Geoff would work.

Greg Hill
Rich Assaf
2008-10-19 19:20:56 UTC
Permalink
Post by Greg Hill
You could do it with Crystal Reports and Marc VDB's wrapper. With his
wrapper you can lauch a form when clicking on the surface of the crystal
report. I have a work version of it.
The sorting would require adding a sort button to the viewer.
One other way would be a lot of work but it could be done with a custom
control on a form. I use a custom control to display children rows that
only require a 3 columns. Its a lot of work to get everything working plus
its runs kind of slow when dynamically creating rows.
I think the temp table mentioned by Geoff would work.
Greg Hill
I haven't worked with Crystal Reports at all ... would a VdB report to
html format be similar? I only recently gave up Vic's printer class in
favor of VdB report engine, so this is all new..

Rich
Loading...