Master-Detail : Sorting Detail? 
Author Message
 Master-Detail : Sorting Detail?

In delphi 1.02, is it possible to sort a detail listing of a master-detail
relationship by an index other than that which links the two datasources?

I have a client database linked by the SSNUM index, but want to display
the detail information by its DATE field.

Thankx In Advance For Your Assistance.



Wed, 16 Dec 1998 03:00:00 GMT  
 Master-Detail : Sorting Detail?
Quote:

> In Delphi 1.02, is it possible to sort a detail listing of a master-detail
> relationship by an index other than that which links the two datasources?

> I have a client database linked by the SSNUM index, but want to display
> the detail information by its DATE field.

> Thankx In Advance For Your Assistance.I have been haveing the same problem in Delphi 2.0.  (See my posting re:dBASE table index problem)  I finally

decided to use a different approach that seems to work although it is slower.  Place a TDataSource and TTable
for both the master and the detail tables.  The index of mastertable should be the same as your previous link.
 The index of the detailtable should be the sort order you want to see.  Use the onfilter event add this code:
accept := detailtable['yourlinkfieldname'] := mastertable['masterlinkfieldname'];

Now when you set detailtable.filtered := true the detailtable shows those records related by the link field in
the proper sorted order.

I must caution you that I am new to Delphi and this is merely an adaption of the techniques used in the Jump
start chapther of the Delphi 2.0 Getting Started manual.

I hope this helps.

If anyone has a solution using the master-detail method I would really appreciate getting it.

TIA
Evertt Byington



Wed, 16 Dec 1998 03:00:00 GMT  
 Master-Detail : Sorting Detail?

:
: Now when you set detailtable.filtered := true the detailtable shows those records related by the link field in
: the proper sorted order.
:
: I must caution you that I am new to Delphi and this is merely an adaption of the techniques used in the Jump
: start chapther of the Delphi 2.0 Getting Started manual.

Unfortunately, there is no such property ('filtered') in Delphi 1



Mon, 21 Dec 1998 03:00:00 GMT  
 Master-Detail : Sorting Detail?

It is true Delphi 1 does not have the 'filtered' property.  An alternate
and perhaps better solution is to use SetRangeStart and SetRangeEnd for
the link field in the detail table.  This has the same effect as the
'filtered' option but seems to work faster.  When the ApplyRange method is
called only those detail records within the range specified will show up
in the dbGrid.  I changed my application to this method and am very happy
with the results.
Hope this helps!

Quote:
On Wednesday, July 03, 1996, Charles wrote...

> :
> : Now when you set detailtable.filtered := true the detailtable shows

those records related by the link field in
Quote:
> : the proper sorted order.
> :
> : I must caution you that I am new to Delphi and this is merely an

adaption of the techniques used in the Jump
Quote:
> : start chapther of the Delphi 2.0 Getting Started manual.

> Unfortunately, there is no such property ('filtered') in Delphi 1



Fri, 25 Dec 1998 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Sorting detail records in a master detail relation.

2. Master - Detail - Detail queries & DBGrids

3. Setting report variables in the detail of a ReportSmith master-detail report

4. Master-detail-detail-detial with Cascade delete

5. Master/Detail lookup - losing detail field

6. Newbie - updating Detail in master-detail

7. HELP: Master-detail form: sequence of detail records

8. Problem when inserting records in the detail table (master/detail relation)

9. Different detail Index order within master-detail relationship

10. Master->Detail->Detail Query Too Slow

11. Yet Another Master/Detail Sorting Query

12. Q: Master-Detail Sort Order

 

 
Powered by phpBB® Forum Software