Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Remove Grayed Check mark from Data Check List

Posted on 2005-04-03
7
Medium Priority
?
304 Views
Last Modified: 2010-04-05
How do I remove the Grayed out check mark using DBCheckBox
0
Comment
Question by:jfgrayiii
  • 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

564 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