Subject Re: [IBO] SelectedBookmarks and SelectAll Problem
Author Jason Wharton
You should call FetchAll along with the call to SelectAll if you want all
records both present and selected. I will look into the SelectedBookmarks( )
method because it should recognize the SelectAll flag and do a fetch all in
such a case. Either way, you have to do a fetch all so just put it in your
code for safety sake.

Regards,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com


----- Original Message -----
From: "mircostange" <mirco@...>
To: <IBObjects@yahoogroups.com>
Sent: Friday, February 22, 2002 12:58 AM
Subject: [IBO] SelectedBookmarks and SelectAll Problem


> Hi Everyone,
>
> My application displays the results of a query in a TIB_Grid control.
> The user can select (mark) rows either with the grid's Ctrl+Click
> feature or press some button to select all rows (which calls SelectAll
> (true)).
> After that, the user can perform various operations on the selected
> rows, e.g delete them. The code for this is pretty straight forward:
>
> s := TStringList.create();
> q.selectedBookmarks(s);
> q.setFocus;
> for i := 0 to s.count-1 do begin
> q.Bookmark := s.strings[i];
> { do whatever ... }
> end;
> s.free;
>
> However, the problem with this approach seems to be that if the user
> selects all rows directly when the app is started (i.e. without
> scrolling through the grid), selectedBookmarks returns an empty list.
>
> Is this a known issue? Any workarounds?
>
> Mirco