Subject | RE: [IBO] How to mark a subset of records as selected? |
---|---|
Author | Adrian Wreyford |
Post date | 2006-11-18T07:42:25Z |
Jason Suggested,
Setup a scan of all the records in the buffer and set the Selected state of
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
Thanks Jason, Works like a charm!
Adrian
[Non-text portions of this message have been removed]
Setup a scan of all the records in the buffer and set the Selected state of
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
Thanks Jason, Works like a charm!
Adrian
[Non-text portions of this message have been removed]