Delphi Checkbox grayed and checked - delphi

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?

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.

Related

MS Access -- Yes/No statement

I want to create a Yes/No row in a table, the row would be called 'prepayment'. So, if there is one, and you check 'Yes' in the form, I want some textbox to appear -- so you could type in the sum of prepayment. Is there some way to do it the way that textbox to type in the sum wouldn't be visible in the form unless you check 'Yes'?
I didn't really try anything yet. Just have no idea how to do it...
Solomon,
Set the Visible property on the Textbox to No.
Create an On_Click event for the Checkbox.
The code for the On_Click event should change the Textbox Visible property to Yes. You might also want to check the current setting of the Textbox Visible property so you can hide it if they uncheck the Checkbox.

fr:number control with a suffix not editable after becoming relevant

I am using an fr:number control with a suffix.
It is relevant at the time the form is displayed and is editable.
On clicking (un-ticking) a tick box, the control is hidden according to custom XPath.
However, when the the tick box is re-ticked, the control reappears but on attempting to edit the text it is readonly.
This behaviour is only apparent in IE (IE11) and when the control has a suffix.
Is this a known bug?

Delphi combobox csOwnerDrawFixed set text property

I am using the csOwnerDrawFixed style to incorporate my style into a TCombobox. The problem is that I can no longer use the Text Property. I suppose it is read only. Is there a way to enable the text property?
No this is not possible. What you are observing is a simple reflection of the underlying Win32 control's behaviour.
When you select the csOwnerDrawFixed style that is mapped to the combo box CBS_OWNERDRAWFIXED style. And when a combo box has that style, then WM_SETTEXT always fails with CB_ERR, and WM_GETTEXT always returns an empty string.
The reason for this is that when you use the csOwnerDrawFixed style then the combo box does not have an associated edit control. Therefore there is nowhere for it to store window text. You only get an associated edit control if the combo box style is csDropDown or csSimple.

Simple question, value not being display in DevExpress's LookupComboBox

This is a Delphi project, but I suspect DevExpress's component works similar for Delphi and .NET.
I have a DevExpress GridDBTableView, when selecting a cell in one of the column, I want a LookupComboBox to show up, where user can select an item, and the value gets display in the table cell. Simple.
I've set the column's Properties set to 'LookupComboBox'.
I have ListColumns setup with 'LocationName' and 'QuantityOnHand'.
ListSource is set to a datasource that's linked a dataset of 'LocationID', 'LocationName', and 'QuantityOnhand'.
ListFieldNames is set to 'LocationName;QuantityOnHand'
When I click on the cell, the combo box shows up with locations for me to choose, but when I choose a location, the table cell doesn't show the location name. In fact, I can't type anything in the cell.
What am I missing?
Ideally, I would like to be able to select a location from the combo box, the location name shows up in the table cell, and I can somehow store the corresponding LocationID that was selected.
I think that you should also set the column's Properties.KeyFieldName property to the KeyField of the Lookup DataSource. In this case, everything should work properly.
OK, all the answer is in the Express Editors' help file article 'Using Lookup Editors'.
The only step I missed was setting the LookupComboBox's KeyFieldNames property to 'LocationID'.

Delphi 7 - cxDBGrid Column : How to display a check mark next to some character string

I have to display in a cxdbGrid column 'Test √', and I got the check mark by using a symbol font but the rest of the characters changed.
I don't have an answer if you do actually need to have the check as part of actual text in the text column. I don't think I've ever seen an app that did it that way though. The usual way of doing this is to add a column to the left or right of the text column in question and have the new column use a checkbox control. Then just set the value of the checkbox column to true or false.
It's quite common to include some type of image to represent the state of a column in a grid control. You could implement your own OnCustomDrawCellEvent to put an icon image there, instead of text and a font. Below is a link to a tutorial of how to accomplish this.
How to draw an icon along with the text in a grid cell

Resources