Subject | RE: [IBO] How to mark a subset of records as selected? |
---|---|
Author | Jason Wharton |
Post date | 2006-11-17T21:59:01Z |
Adrian,
each record individually.
You can do this as follows:
var
MyBufFld: TIB_Column;
begin
with MyQuery do
begin
Active := true;
FetchAll;
MyBufFld := BufferFieldByName( 'MYCOL' );
BufferFirst;
while ( not BufferEof ) do
begin
Selected[ BufferRowNum ] := ( MyBufFld.AsString = 'aa' );
BufferNext;
end
end
end
The only disadvantage I can think of is you will get a separate notification
for each record that has its selected status changed rather than getting a
single notification that a general dataset-wide multi-select operation
occurred.
HTH,
Jason Wharton
> I have a query, displayed in a grid.Setup a scan of all the records in the buffer and set the Selected state of
> I want to mark 'Select' certains rows, based on selection criteria.
> Ie mark all rows with value = 'aa' as selected.
> SelectAll, and deselect all, and select rows between a range
> are possible.
> But how do I achieve above?
each record individually.
You can do this as follows:
var
MyBufFld: TIB_Column;
begin
with MyQuery do
begin
Active := true;
FetchAll;
MyBufFld := BufferFieldByName( 'MYCOL' );
BufferFirst;
while ( not BufferEof ) do
begin
Selected[ BufferRowNum ] := ( MyBufFld.AsString = 'aa' );
BufferNext;
end
end
end
The only disadvantage I can think of is you will get a separate notification
for each record that has its selected status changed rather than getting a
single notification that a general dataset-wide multi-select operation
occurred.
HTH,
Jason Wharton