Board index » delphi » TDBCheckBox problem

TDBCheckBox problem

Hi,

This is driving me bananas!

I'm using the latest version of Delphi3 (3.02). I have a form with a
TDBNavigator and a number of TDBCheckBoxes: the underlying database
fields are all TBooleanFields.

What is driving me bonkers is that I cannot set a checkbox programati-
cally (with either the Checked or State properties) and have the value
end up in the corresponding database field. If the user actually clicks
on the box, there's no problem, it works fine.

However, the form is setting up a configuration record, so there are
times when I want to set the value of one or more boxes depending on a
user selection. The alternative of checking the user's selection after
he or she has clicked everything would make nonsense of the phrase
'Rapid Application Development'!

The root of the problem appears to lie somewhere in whatever executes
when you select either Insert or Post on the DBNavigator - inspecting
properties immediately after Insert has initialized them displays strong
evidence of some very woolly thinking, and some very lax testing!

I can work around the problem by setting the relevant database field's
Value property directly, but then it makes the code about three times as
long, and what are data-aware controls for? Why am I paying for a dog
and barking myself?

Before I lay into Borland properly, have I missed anything obvious, and/
or is there a better work-around?

Please e-mail answers or (polite) suggestions (or death threats from
Borland) to 'cashbacs....@{*word*269}.net'.

Regards,

Stuart

 

Re:TDBCheckBox problem


I'll give this one a try...because I had the same problem.

Update the underlying field in the Dataset and your checkbox will then show
right.
--

=======================================
codi...@airmail.NOSPAM.net
bgrav...@vha.NOSPAM.com
=======================================

Stuart <cashbacs....@{*word*269}.net> wrote in article
<34FC451F.1...@{*word*269}.net>...

Quote
> Hi,

> This is driving me bananas!

> I'm using the latest version of Delphi3 (3.02). I have a form with a
> TDBNavigator and a number of TDBCheckBoxes: the underlying database
> fields are all TBooleanFields.

> What is driving me bonkers is that I cannot set a checkbox programati-
> cally (with either the Checked or State properties) and have the value
> end up in the corresponding database field. If the user actually clicks
> on the box, there's no problem, it works fine.

> However, the form is setting up a configuration record, so there are
> times when I want to set the value of one or more boxes depending on a
> user selection. The alternative of checking the user's selection after
> he or she has clicked everything would make nonsense of the phrase
> 'Rapid Application Development'!

> The root of the problem appears to lie somewhere in whatever executes
> when you select either Insert or Post on the DBNavigator - inspecting
> properties immediately after Insert has initialized them displays strong
> evidence of some very woolly thinking, and some very lax testing!

> I can work around the problem by setting the relevant database field's
> Value property directly, but then it makes the code about three times as
> long, and what are data-aware controls for? Why am I paying for a dog
> and barking myself?

> Before I lay into Borland properly, have I missed anything obvious, and/
> or is there a better work-around?

> Please e-mail answers or (polite) suggestions (or death threats from
> Borland) to 'cashbacs....@{*word*269}.net'.

> Regards,

> Stuart

Other Threads