ROBLEMMENS
Programmer
I'm using IB_Grids, the only way i know to get all selected rows is to loop the buffer and check if a row is selected, like this:
q.BufferFirst;
While not q.BufferEOF do begin
if q.Selected[q.BufferRowNum] then begin
if(WhatInList = COL_NUMBERS) then
sl.Add(IntToStr(q.BufferFields.Values['COL_NR']))
else if(WhatInList = DOC_NUMBERS) then
sl.Add(IntToStr(q.BufferFields.Values['DOC_NR']));
end;
q.BufferNext;
end;
This works fine for small tables but for a table with 200000 rows this method is really slow. Is there a way to get the selected rows directly without traversing the buffer?
q.BufferFirst;
While not q.BufferEOF do begin
if q.Selected[q.BufferRowNum] then begin
if(WhatInList = COL_NUMBERS) then
sl.Add(IntToStr(q.BufferFields.Values['COL_NR']))
else if(WhatInList = DOC_NUMBERS) then
sl.Add(IntToStr(q.BufferFields.Values['DOC_NR']));
end;
q.BufferNext;
end;
This works fine for small tables but for a table with 200000 rows this method is really slow. Is there a way to get the selected rows directly without traversing the buffer?