I have been working with Delphi for about a month now so I'm relatively new. I have a checkbox that greys out when I change the data field just want to know why that might be?
Asked
Active
Viewed 1,568 times
-2
-
Well, when I try it doesn't grey out. You must be doing something differently, I just don't know what. Iow, how can we reproduce? Please read about [**Asking**](http://stackoverflow.com/help/asking). – Tom Brunberg Jun 15 '17 at 07:48
-
@TomBrunberg Hi Tom, Not exactly sure how to tell you to reproduce the problem as the button has no functionality code. what I can tell you is that it is a TDBCheckBox and when my code is running I'm still able to check and uncheck the box and as soon as I uncheck it the grayed-out part goes away it as the check box. I copied the original checkbox and pasted it in the exact same aria changed the DataField and the grayed-out part goes away and it functions as a normal checkbox – Timothy Prinsloo Jun 15 '17 at 08:11
-
Please provide a [mcve] – David Heffernan Jun 15 '17 at 08:22
-
@TomBrunberg object DBCheckBox1: TDBCheckBox Left = 161 Top = 424 Width = 20 Height = 17 DataField = 'Ignore Producer ID Allocation' DataSource = LookupDM.FarmDS TabOrder = 27 ValueChecked = 'True' ValueUnchecked = 'False' end – Timothy Prinsloo Jun 15 '17 at 08:24
-
Please don't add details in comments. Edit them into the question. – David Heffernan Jun 15 '17 at 11:51
1 Answers
5
Your TDBCheckBox is grayed because the value of the datafield assigned to it does not match ValueChecked or ValueUnchecked properties.From documentation
If the contents of the field matches no string in either ValueChecked or ValueUnchecked, the check box appears gray.

RBA
- 12,337
- 16
- 79
- 126
-
Thank you so mutch this actually helped as it was the Null value in my DB causing this to happen and I will bookmark that page you linked – Timothy Prinsloo Jun 15 '17 at 11:44