Board index » delphi » DBGRID > PLEASE HELP : how to put a (db)checkbox on a DBGRID please ?

DBGRID > PLEASE HELP : how to put a (db)checkbox on a DBGRID please ?

I mannaged to implement solutions on several questions on Tdbgrid, thanks
for that.
Unfortunatelly I can't find good code to use a (db)checkbox on a dbgrid.

Most of the code on the net uses an Obsolete (OnDrawDataCell) event in  D5
to put a checkbox on a grid.
Has anyone good, working code in D5 to add a checkbox for boolean fields
please !!!???

Thanks for helping me out !

Phil

 

Re:DBGRID > PLEASE HELP : how to put a (db)checkbox on a DBGRID please ?


Use OnDrawColumnCell event instead.

--
Robert

Quote
Phil Di Guillielmo wrote in message <3cf20e65_1@dnews>...
>I mannaged to implement solutions on several questions on Tdbgrid, thanks
>for that.
>Unfortunatelly I can't find good code to use a (db)checkbox on a dbgrid.

>Most of the code on the net uses an Obsolete (OnDrawDataCell) event in  D5
>to put a checkbox on a grid.
>Has anyone good, working code in D5 to add a checkbox for boolean fields
>please !!!???

>Thanks for helping me out !

>Phil

Re:DBGRID > PLEASE HELP : how to put a (db)checkbox on a DBGRID please ?


Hi Robert,
I tried,
but I got checkboxes on ALL the fields, even if I did a check on the fields
name.
I gave up trying since I can't see what is wrong...
Phil

Quote
"Robert Cerny" <robert.qwe.ce...@neosys.xrs.qwe.si> wrote in message

news:actcp0.1ns0.1@neosys.xrs.si...
Quote
> Use OnDrawColumnCell event instead.

> --
> Robert

> Phil Di Guillielmo wrote in message <3cf20e65_1@dnews>...
> >I mannaged to implement solutions on several questions on Tdbgrid, thanks
> >for that.
> >Unfortunatelly I can't find good code to use a (db)checkbox on a dbgrid.

> >Most of the code on the net uses an Obsolete (OnDrawDataCell) event in
D5
> >to put a checkbox on a grid.
> >Has anyone good, working code in D5 to add a checkbox for boolean fields
> >please !!!???

> >Thanks for helping me out !

> >Phil

Re:DBGRID > PLEASE HELP : how to put a (db)checkbox on a DBGRID please ?


Go to http://www.gjl-software.co.uk/ there is a freeware DBGrid with source
that does this, you could either use it or have a look as to how it is done,
also another grid around called GXDBGrid try searching on google that does
the same thing.

" Phil Di Guillielmo" <removethis_filip.will...@advalvas.be> wrote in
message news:3cf20e65_1@dnews...

Quote
> I mannaged to implement solutions on several questions on Tdbgrid, thanks
> for that.
> Unfortunatelly I can't find good code to use a (db)checkbox on a dbgrid.

> Most of the code on the net uses an Obsolete (OnDrawDataCell) event in  D5
> to put a checkbox on a grid.
> Has anyone good, working code in D5 to add a checkbox for boolean fields
> please !!!???

> Thanks for helping me out !

> Phil

Re:DBGRID > PLEASE HELP : how to put a (db)checkbox on a DBGRID please ?


Hi, Andy,

I can find a site or three talking about GxDbGrid, but I have no succes
downloading a version for D5.
You do not have it perhaps ?
Phil

Quote
"Andy Vines" <andyvi...@amcukfasteners.co.uk> wrote in message

news:3cf33325_2@dnews...
Quote
> Go to http://www.gjl-software.co.uk/ there is a freeware DBGrid with
source
> that does this, you could either use it or have a look as to how it is
done,
> also another grid around called GXDBGrid try searching on google that does
> the same thing.

> " Phil Di Guillielmo" <removethis_filip.will...@advalvas.be> wrote in
> message news:3cf20e65_1@dnews...
> > I mannaged to implement solutions on several questions on Tdbgrid,
thanks
> > for that.
> > Unfortunatelly I can't find good code to use a (db)checkbox on a dbgrid.

> > Most of the code on the net uses an Obsolete (OnDrawDataCell) event in
D5
> > to put a checkbox on a grid.
> > Has anyone good, working code in D5 to add a checkbox for boolean fields
> > please !!!???

> > Thanks for helping me out !

> > Phil

Re:DBGRID > PLEASE HELP : how to put a (db)checkbox on a DBGRID please ?


Hello, !
You wrote  on Tue, 28 May 2002 09:02:48 +0200:

One approach i've heard was:

1) add to the DataSet Calculated Field : char[1];
2) Show it on the grid instead of Boolean with WinDing font;
3) Use OnCellClick event to toggle boolean field.
4) Set DataSet.OnCalcFields event to assign calculated field to a symbol
that is draw as an empty|marked checkbox in WinDing font, according to value
of Boolean field.

Quote
>> >Most of the code on the net uses an Obsolete (OnDrawDataCell) event
>> in D5

What's wrong? Obsolete do not mean 'works no more' or it does?

With best regards, Arioch /BDV/.  E-mail: the_Ari...@yahoo.com

Re:DBGRID > PLEASE HELP : how to put a (db)checkbox on a DBGRID please ?


HI,

Thanks for answering,
I certainly will test it in the hours to come.

Regarding obsolete : yes, it means that it works no more. Try to put  a
Showmessage in it.
It will NEVER be displayed in D5.

Greets,
Phil.

Quote
"Arioch /BDV/" <the_Ari...@yahoo.com> wrote in message

news:3cf38fd9$1_1@dnews...
Quote
> Hello, !
> You wrote  on Tue, 28 May 2002 09:02:48 +0200:

> One approach i've heard was:

> 1) add to the DataSet Calculated Field : char[1];
> 2) Show it on the grid instead of Boolean with WinDing font;
> 3) Use OnCellClick event to toggle boolean field.
> 4) Set DataSet.OnCalcFields event to assign calculated field to a symbol
> that is draw as an empty|marked checkbox in WinDing font, according to
value
> of Boolean field.

> >> >Most of the code on the net uses an Obsolete (OnDrawDataCell) event
> >> in D5

> What's wrong? Obsolete do not mean 'works no more' or it does?

> With best regards, Arioch /BDV/.  E-mail: the_Ari...@yahoo.com

Re:DBGRID > PLEASE HELP : how to put a (db)checkbox on a DBGRID please ?


*** FANTASTIC ***
Afterwards it seems such an easy solution, but what a brilliant idea !
I use the on doubleclick event instead, but this easy to write code does
everything what I need !
THANKS A LOT !!

Phil

" Phil Di Guillielmo" <removethis_filip.will...@advalvas.be> wrote in
message news:3cf49403$1_2@dnews...

Quote
> HI,

> Thanks for answering,
> I certainly will test it in the hours to come.

> Regarding obsolete : yes, it means that it works no more. Try to put  a
> Showmessage in it.
> It will NEVER be displayed in D5.

> Greets,
> Phil.

> "Arioch /BDV/" <the_Ari...@yahoo.com> wrote in message
> news:3cf38fd9$1_1@dnews...
> > Hello, !
> > You wrote  on Tue, 28 May 2002 09:02:48 +0200:

> > One approach i've heard was:

> > 1) add to the DataSet Calculated Field : char[1];
> > 2) Show it on the grid instead of Boolean with WinDing font;
> > 3) Use OnCellClick event to toggle boolean field.
> > 4) Set DataSet.OnCalcFields event to assign calculated field to a symbol
> > that is draw as an empty|marked checkbox in WinDing font, according to
> value
> > of Boolean field.

> > >> >Most of the code on the net uses an Obsolete (OnDrawDataCell) event
> > >> in D5

> > What's wrong? Obsolete do not mean 'works no more' or it does?

> > With best regards, Arioch /BDV/.  E-mail: the_Ari...@yahoo.com

Re:DBGRID > PLEASE HELP : how to put a (db)checkbox on a DBGRID please ?


Quote
Phil Di Guillielmo wrote in message <3cf49403$1_2@dnews>...
>HI,

>Regarding obsolete : yes, it means that it works no more. Try to put  a
>Showmessage in it.
>It will NEVER be displayed in D5.

Completely wrong. Obsolete means that it is provided for backward
compatibility and it should not be used anymore. But it still works if used
in old way. IOW, it does not work if you create columns, because columns
functionality is incompatible. Drawdatacell in old versions could assume the
field was never nil, which may fail, if you create columns. Actually you
should say big thanks to Borland for providing backward compatibility with a
secutity fuse.

--
Robert

Re:DBGRID > PLEASE HELP : how to put a (db)checkbox on a DBGRID please ?


Hello, !
DG> Afterwards it seems such an easy solution,

Russian Fido Delphi FAQ if i remeber it right. You are welcome :)

With best regards, Arioch /BDV/.  E-mail: the_Ari...@yahoo.com

Re:DBGRID > PLEASE HELP : how to put a (db)checkbox on a DBGRID please ?


Hi Robert,
I assume you're right, but I found code on the net wich uses this event and
the code is not working...
(UDDF on gnomehome). Since this site was always very reliable I assumed that
it was a D5 problem...
Phil
Still, a showmessage in this event never pops up....

Quote
"Robert Cerny" <robert.qwe.ce...@neosys.xrs.qwe.si> wrote in message

news:ad2iep.1nn0.1@neosys.xrs.si...
Quote
> Phil Di Guillielmo wrote in message <3cf49403$1_2@dnews>...
> >HI,

> >Regarding obsolete : yes, it means that it works no more. Try to put  a
> >Showmessage in it.
> >It will NEVER be displayed in D5.

> Completely wrong. Obsolete means that it is provided for backward
> compatibility and it should not be used anymore. But it still works if
used
> in old way. IOW, it does not work if you create columns, because columns
> functionality is incompatible. Drawdatacell in old versions could assume
the
> field was never nil, which may fail, if you create columns. Actually you
> should say big thanks to Borland for providing backward compatibility with
a
> secutity fuse.

> --
> Robert

Re:DBGRID > PLEASE HELP : how to put a (db)checkbox on a DBGRID please ?


Yes I do have it, if you still want a copy let me know.

Andy

" Phil Di Guillielmo" <removethis_filip.will...@advalvas.be> wrote in
message news:3cf35100$1_1@dnews...

Quote
> Hi, Andy,

> I can find a site or three talking about GxDbGrid, but I have no succes
> downloading a version for D5.
> You do not have it perhaps ?
> Phil

> "Andy Vines" <andyvi...@amcukfasteners.co.uk> wrote in message
> news:3cf33325_2@dnews...
> > Go to http://www.gjl-software.co.uk/ there is a freeware DBGrid with
> source
> > that does this, you could either use it or have a look as to how it is
> done,
> > also another grid around called GXDBGrid try searching on google that
does
> > the same thing.

> > " Phil Di Guillielmo" <removethis_filip.will...@advalvas.be> wrote in
> > message news:3cf20e65_1@dnews...
> > > I mannaged to implement solutions on several questions on Tdbgrid,
> thanks
> > > for that.
> > > Unfortunatelly I can't find good code to use a (db)checkbox on a
dbgrid.

> > > Most of the code on the net uses an Obsolete (OnDrawDataCell) event in
> D5
> > > to put a checkbox on a grid.
> > > Has anyone good, working code in D5 to add a checkbox for boolean
fields
> > > please !!!???

> > > Thanks for helping me out !

> > > Phil

Re:DBGRID > PLEASE HELP : how to put a (db)checkbox on a DBGRID please ?


Hi Andy,
though I solved my problem thanks to Arioch, I'm still curious, maybe on
extra possibilities of this component.
Thanks for sending.
Phil

Quote
"Andy Vines" <andyvi...@amcukfasteners.co.uk> wrote in message

news:3d04ba49_1@dnews...
Quote
> Yes I do have it, if you still want a copy let me know.

> Andy

> " Phil Di Guillielmo" <removethis_filip.will...@advalvas.be> wrote in
> message news:3cf35100$1_1@dnews...
> > Hi, Andy,

> > I can find a site or three talking about GxDbGrid, but I have no succes
> > downloading a version for D5.
> > You do not have it perhaps ?
> > Phil

> > "Andy Vines" <andyvi...@amcukfasteners.co.uk> wrote in message
> > news:3cf33325_2@dnews...
> > > Go to http://www.gjl-software.co.uk/ there is a freeware DBGrid with
> > source
> > > that does this, you could either use it or have a look as to how it is
> > done,
> > > also another grid around called GXDBGrid try searching on google that
> does
> > > the same thing.

> > > " Phil Di Guillielmo" <removethis_filip.will...@advalvas.be> wrote in
> > > message news:3cf20e65_1@dnews...
> > > > I mannaged to implement solutions on several questions on Tdbgrid,
> > thanks
> > > > for that.
> > > > Unfortunatelly I can't find good code to use a (db)checkbox on a
> dbgrid.

> > > > Most of the code on the net uses an Obsolete (OnDrawDataCell) event
in
> > D5
> > > > to put a checkbox on a grid.
> > > > Has anyone good, working code in D5 to add a checkbox for boolean
> fields
> > > > please !!!???

> > > > Thanks for helping me out !

> > > > Phil

Other Threads