Recent

Author Topic: Multiple selection in DBGrid with Checkbox column  (Read 18232 times)

Giu

  • Full Member
  • ***
  • Posts: 131
Multiple selection in DBGrid with Checkbox column
« on: June 22, 2011, 11:40:33 pm »
Hi all,

Here I am, trying to remember all my delphi knowledge I had, without success :D

I Have a table A, and table B with some records, and I want to associate more than 1 "B record" with one "A record". For this reason, table C born.

In a Form, I have a DBLookupCombobox asociated with Table A, and a DBGrid with Table B records. In this DBGrid, I added a column of type checkbox.

My intention, is, to create one record in Table C, for every "selected" record in DBGrid, with ID of Table A and Table B, to make the association.

IIRC, I should go over the grid records checking if checkbox column is marked, and if so, add the record with TableADatasetID and TableBDatasetID, but, I don't remember how to go over the grid, and if this is the right way.

The problem, is, thath I don't remember how to do this  :-*

A simple approach should be enough, I developed a lot in Delphi in the past, but was a lot of years ago, and I'm away of programming world since then (sad)

Zoran

  • Hero Member
  • *****
  • Posts: 1988
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Multiple selection in DBGrid with Checkbox column
« Reply #1 on: June 23, 2011, 10:14:18 pm »
I am not sure, but maybe this article will help — "Selecting Records in a DBGrid using checkboxes".
Swan, ZX Spectrum emulator https://github.com/zoran-vucenovic/swan

Giu

  • Full Member
  • ***
  • Posts: 131
Re: Multiple selection in DBGrid with Checkbox column
« Reply #2 on: June 23, 2011, 10:55:20 pm »
 :o I will check tomorrow. Thanks.

I swear I searched for it  :-\

 

TinyPortal © 2005-2018