Link to home
Start Free TrialLog in
Avatar of Pegasus100397
Pegasus100397

asked on

Highlighted DBGrid entries, getting first & last...

Hi!

I have a DBGrid attached to a table with about 630,000 entries in the table. The DBGrid is set to multiselect so the user can highlight (tag) any number of entries that interest them.

I can use a loop, starting from the first record and scanning all the entries until I come upon a DBGrid.SelectedRows.CurrentRowSelected to determine if a row is selected or not, but certainly there must be a better way to determine the first and last entries the user selected and just scan the records in between to find out which ones are selected as opposed to scanning the entire table!

The DBGrid component uses TBookmarks to keep track of the records the user selected but the documentation is horrible about TBookmarks. Is there a BookmarkFirst or BookmarkLast something or another to remedy this situation.

I'd appreciate hearing some creative solutions to this seemingly simple problem : )

Pegasus
My question is this.

ASKER CERTIFIED SOLUTION
Avatar of ronit051397
ronit051397

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Pegasus100397
Pegasus100397

ASKER

Ronit,

Thanks for the answer! Solved my problem in 3 lines of code!

Talk about obscure documentation! I've never looked (or known  of Manuals.TXT) but found gobs of stuff in there pertaining to questions I've had. Thanks for turning me on to it. (I'll never say that REAL programmers never read the documentation again!).

Again, thanks for the answer!
Pegasus