Subject | Re: [IBO] How to use a CheckBox in Grid for selecting multiple rows |
---|---|
Author | Lucas Franzen |
Post date | 2005-04-06T18:49:34Z |
Michael,
Michael L. Horne schrieb:
Create a TStringList in your form.
Add a calculated field to your query, make all necessary settings for it
to represent a boolean value.
Every time you (un)select a record remove or add the bookmark of the
record of this StringList, and the calculated field will get it's value
from that stringlist, too.
All in all: I prefer the "visual selecting".
You can add some buttons (or a popup menu or whatever) to supply
functions like:
- select all
- select none
- toggle selected
- (un) select current record (which is also bound to the Grid-Dblclick
event).
I think it's easier to see if a record is marked or not that way ...
Luc.
Michael L. Horne schrieb:
> Hello,The only way that coems to my mind is:
>
> I need to supply a checkbox for the users
> to select multiple rows for processing in
> a query.
>
> I know how to do it with the CTRL-Click or
> SHIFT-Click but how can I do the same with
> a checkbox. I would prefer to not add
> an additional field to the db.
Create a TStringList in your form.
Add a calculated field to your query, make all necessary settings for it
to represent a boolean value.
Every time you (un)select a record remove or add the bookmark of the
record of this StringList, and the calculated field will get it's value
from that stringlist, too.
All in all: I prefer the "visual selecting".
You can add some buttons (or a popup menu or whatever) to supply
functions like:
- select all
- select none
- toggle selected
- (un) select current record (which is also bound to the Grid-Dblclick
event).
I think it's easier to see if a record is marked or not that way ...
Luc.