Board index » delphi » Row n° in dbgrid / sort data in Dbgrid

Row n° in dbgrid / sort data in Dbgrid

How to know what is the row n currently used in a dbgrid without using the
record n of the associate table??

How to sort data in a dbrid before the transaction commit ? (I want ot sort
a detail table in a master / detail relation and the 'order by ' statment in
the select and refresh clauses  doesn't work)

 

Re:Row n° in dbgrid / sort data in Dbgrid


Quote
Didier corbasson wrote:

> How to know what is the row n currently used in a dbgrid without using the
> record n of the associate table??

        InterBase has no concept of record numbers.  You need to use the
primary key of the table or the RDB$DB_KEY (valid only in a single
transaction).

Quote
> How to sort data in a dbrid before the transaction commit ? (I want ot sort
> a detail table in a master / detail relation and the 'order by ' statment in
> the select and refresh clauses  doesn't work)

        ORDER BY is the right way to do this -- in SelectSQL, your RefreshSQL
should return only a single record.  If ORDER BY is not working for you,
you're doing something wrong.  Perhaps you're calling
TIBDataset.Refresh, which refreshes only the current record, not the
entire dataset.  Close and re-open the dataset to refresh the entire
dataset.

        -Craig

--
 Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
We're hiring: http://www.vertexsoftware.com/careerops.htm#sd
     Delphi/InterBase WebLog: http://delphi.weblogs.com

Other Threads