?
Solved

Remove Grayed Check mark from Data Check List

Posted on 2005-04-03
7
Medium Priority
?
301 Views
Last Modified: 2010-04-05
How do I remove the Grayed out check mark using DBCheckBox
0
Comment
Question by:jfgrayiii
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 11

Assisted Solution

by:shaneholmes
shaneholmes earned 1000 total points
ID: 13693643
Never leave the field value blank. You can write an event handler to the
OnNewRecord event of the TTable (if thats what your using) to set its value
as FALSE. Leaving it blank will surely cause it to be grey  - or set the default value of the field in your database.

sholmes
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 13693648
procedure TfrmData.tblCachesNewRecord(DataSet: TDataSet);
begin
 Dataset.FieldByName('MyField').asBoolean:= 'False';
end;


sholmes
0
 

Author Comment

by:jfgrayiii
ID: 13693702
procedure TForm1.DBCheckBox9Click(Sender: TObject);
begin

end;

How Would it read in the above example
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 11

Expert Comment

by:shaneholmes
ID: 13693723
no, in order for the checkbox component to work, your field has to have a value in there (in your table in the database). It can not be null.
When you create the table in your database, you did not set a default value for this field did you?

Is it a boolean field?

You will need to first set the value of the field either in design time or runtime to a default - then you can click and set toggle the value back and fourth

sholmes
0
 
LVL 17

Accepted Solution

by:
TheRealLoki earned 1000 total points
ID: 13694019
With the DBCheckbox set the "AllowGreyed" property to false as well, so users can not create records with this null value either.
In your fields list, find the boolean field and set its' default value to False
0
 

Author Comment

by:jfgrayiii
ID: 13718244
I am using a paradox 7 database. That i created using database desktop. The field type is Set to  Alpha filld length is 30

I have tried to set a default value of    F  but still get gray check mark
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 13720482
Alpha 30? Why aren't you using "Logical" (which is a boolean, allows true/false)
a checkbox only works well with boolean fields

If you really want to use an Alpha 30 then you can, but you will have to change the DBCheckbox
in the object inspector set the "ValueChecked" and "ValueUnChecked"

e.g if you want the checkbox to be ticked when the field contains "on", and unticked when it says "off" you would have

Checkbox1.ValueChecked := 'on'; // default i s 'True'
Checkbox1.ValueUnChecked := 'off';  // default is 'False';

personaly, i'd have the field set a s logical (boolean) :-)
hth, Loki
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question