Subject | Jason - Re: bookmarks |
---|---|
Author | Rick Roen |
Post date | 2004-12-08T20:41:19Z |
Here is some more information...
I put Jason's name in the subject since I though he might want to
have a look to see if this "as designed".
I added a popup to execut Query.SelectAll( True ).
The grid I am showing is from a Filtered Query. When it is in
filtered mode, showing only a few rows, this does select all the
rows, but it also selects ALL of the rows in the unfiltered dataset
as well, which I can see by setting Filtered := False.
It seems like the RowsAffected, SelectAll() do not respect the
filter which is not what I would expect.
My code works ok, since when I iterate through the Filterd rows in
the grid, I only act on the ones that are bookmarked.
What do you think?
Rick
I put Jason's name in the subject since I though he might want to
have a look to see if this "as designed".
I added a popup to execut Query.SelectAll( True ).
The grid I am showing is from a Filtered Query. When it is in
filtered mode, showing only a few rows, this does select all the
rows, but it also selects ALL of the rows in the unfiltered dataset
as well, which I can see by setting Filtered := False.
It seems like the RowsAffected, SelectAll() do not respect the
filter which is not what I would expect.
My code works ok, since when I iterate through the Filterd rows in
the grid, I only act on the ones that are bookmarked.
What do you think?
Rick
--- In IBObjects@yahoogroups.com, "Rick Roen" <rick@l...> wrote:
>
> Delphi 7
> Firebird 1.5
>
> I'm working with a TIB_Grid connected to a view in a TIB_Query
that
> has one updateable field.
>
> The user selects multiple fields then right clicks in the grid to
> bring up a popup and marks the bookmarked rows "Complete".
>
> When I track the RowsAffected and RowsSelected properties, I get
> incorrect numbers back like 349 for each value. This is when only
> ONE row is actually updated.
>
> The code is below.
>
> ALSO, is there some method to clear the bookmarked fields in a
grid?
>
> TIA,
>
> Rick
>
> _____________________________
> "Selected" is a stringlist object...
>
> Count := 0;
> SelCount := 0;
>
>
> DMOrders1.QPendingItems.BeginBusy( False );
>
> for i := 0 to Selected.Count -1 do
> if DMOrders1.QPendingItems.BookmarkSelected[ Selected[ i ] ]
> then begin
> //Inc( Count );
> //DMOrders1.QPendingItems.DeleteBookmark( Selected[ i ] );
> DMOrders1.QPendingItems.Edit;
> DMOrders1.QPendingItems.FieldByName
( 'Complete' ).AsInteger :=
> 1;
> DMOrders1.QPendingItems.PostRetaining;
> Count := Count + DMOrders1.QPendingItems.RowsAffected;
> SelCount := SelCount + DMOrders1.QPendingItems.RowsSelected;
> end; //if bookmark selected
>
> DMOrders1.QPendingItems.EndBusy;
>
>
> MessageDlg( 'marked complete: ' + inttostr( Count ) + '
> selected: ' + Inttostr( SelCount ), mtInformation, [ mbOK ], 0 );
>
> _____________________________