Subject RE: [IBO] Howto multi select
Author Stuart Hunt
Burak,
the way I got it to work was to set:

IB_Grid.Multiselected:=TRUE

this allows the user to select multiple items. Then, to determine which
items are selected, I use buffers:

var ItemsSelected: TStringList;
thisRow: Integer;

ItemsSelected:=TStringList.Create;
try
if (IB_Query.BufferRowCount>0)
then begin
{scroll through the buffer so (a) we only check
against rows
actually brought back to the client and (b) we
don't cause the main
dataset to scroll:}
IB_Query.BufferFirst;
while not IB_Query.BufferEOF
do begin
thisRow:=IB_Query.BufferRowNum;
//change the FieldByName as appropriate:
if IB_Query.Selected[thisRow]
then
ItemsSelected.Add(IB_Query.BufferFieldByName('ID').AsString);
IB_Query.BufferNext;
end; //while not IB_Query.BufferEOF do begin
end; //if (IB_Query.BufferRowCount>0) then begin
//ItemsSelected now contains the IDs of all selected rows
finally
ItemsSelected.Free;
end;

This works great and is extremely quick.
HTH,
Stuart Hunt
Senior Developer
IdeaGen Software PLC


-----Original Message-----
From: Burak OZLER [mailto:burak.ozler@...]
Sent: Tuesday, 09 July 2002 09:53 AM
To: IBObjects@yahoogroups.com; FBIBOTR@yahoogroups.com
Subject: [IBO] Howto multi select


Hi all,

I try to multi select from a IB_Grid for 2 hours but no success. I'm
trying to use selected as FAQ says and selectedbookmarks..

Any piece of code will be wery valuable...

Thanks...

Burak OZLER
Üçüncü Bilgisayar
MagicSoft
+90 232 464 89 33 / 123


[Non-text portions of this message have been removed]



___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/