Subject | bookmarks |
---|---|
Author | Rick Roen |
Post date | 2004-12-08T14:34:17Z |
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 );
_____________________________
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 );
_____________________________