Subject Re: [IBO] TIB_Grid: Number of selected rows?
Author Geoff Worboys
> > MyStringList.Clear;
> > IB_Query.SelectedBookmarks(MyStringList);
> > if MyStringList.Count >0 then ..........
> Yes, that's the way I do it but I think that's a bit
> oversized :-)
> What about performance if lots of rows are selected? To
> update my status bar, I call this function for every
> click on the grid...

Because the bookmarks are simply the hexstring of the primary key
(which is generally only small) the performance hit is not usually too
bad. However I would still avoid it for calls that are to be made
very often.

There is a solution that I use, but it requires fairly tight control
over the interface. I allow the user to select/deselect rows by
clicking on the left border cell or by pressing Ctrl+T (T for Tag,
which is the term I use with the end-user to avoid confusion of
selecting text in a field).

Because my user interface is tightly regulated I have been able to
setup an internal counter that I inc/dec according to select/deselect
requests. I build a small Recalc function to do a full recalculation
whenever it seems necessary, for example when a user does Ctrl+A (for
Tag All).

Geoff Worboys
Telesis Computing