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.
Related
Advanced Installer 8.9
I have 9 check-box on a selection dialog ,on which i need to allow maximum selection of any three check-boxes.
We can show a message box displaying that only three can be selected or disable next button .
Trying to do permutation and combination will be a filthy task,is there any way where i can set a counter which increments on selection of check-boxes.
The easiest way is to create a very simple custom action in C# that checks the value of each property attached with your checkboxes. You need to call this DLL using a published event, from each checkbox, so when a user tries to select it, first the custom action checks to see if other checkboxes are not selected. If there are already 3 checkboxes selected then you need to delete the property of the new checkbox, like this:
session["CHECKBOX_PROP_1"] = "[~]";
Of course you can also use a C++ custom action if you prefer this language.
The help indicates that adding gboGroupStyle to the ButtonOptions on a TButtonGroup:
"Specifies that the buttons should inherit the group style that is set on the container."
But this explanation still leaves me lost - any ideas?
The gboGroupStyle option in the TButtonGroup.ButtonOptions property has nothing to do with GroupIndex as it's known e.g. from TSpeedButton.
Setting of the gboGroupStyle option to True allows you to:
set the TButtonGroup.ItemIndex property, so you can predefine which button will be focused as default, nothing cool
click the buttons with ENTER or SPACE keys, what will fire the TGrpButtonItem.OnClick event of the button item (if assigned), perform its action, or fire the TButtonGroup.OnButtonClicked event
I agree the name of this is quite misleading, but that's what I found in the source code from Delphi-XE2.
gboGroupStyle makes the TButtonGroup act as a group - that means, one and only one button is selected at a given time. It is similar to grouping several TSpeedButtons with the GroupIndex, where only one button inside that group is selected at any time. The currently selected button can be read and written via the ItemIndex property of TButtonGroup. To visualize the selected button one can implement an OnBeforeDrawButton or OnDrawButton handler.
From my experimentation it looks like if gboGroupStyle is used then the ItemIndex property can be set to something other than -1, so that the TButtonGroup remembers the last button that was pressed.
In cxGrid I have a column with property Options.Editing:=False; Properties:=CheckBox. So, user can not change state of the checkboxes. But the checkboxes still have custom color and user does't see that he can not edit them.
How do I make checkboxes grey in a cxGrid column, which one can not edit?
You can use OnCustomDrawCell event to draw a disabled checkbox.
Check out: http://www.devexpress.com/Support/Center/p/Q253981.aspx
You could make an OnCustomDrawCell event on the grid view, with something like:
if not AViewInfo.Item.Options.Editing then
ACanvas.Brush.Color := clGray;
Columns that are not editable will not become grey. This goes for all kinds of editors, be they checkboxes, textedits or whatever. The checkbox has a property for NullStyle that can be set to nssGrayedChecked, but this will only be displayed for NULL values.
You have some other options, though. The simplest may be to set the column to not focusable, as well as not editable (Options.Focusing = false). This will perhaps make it easier for your users to understand why they can't change the value. THe second easiest option is to use a custom style that in some way indicates a disabled/noneditable column, for instance by having a grey background color.
Use cxStyleRepository
<TcxGridDbColumn>.styles.Content
I have a dropdown list in which I select how many people are going to a party. When the user changes the value of the dropdown list, I want as many fields as the number selected to appear and hide the rest.
But I don't know how can I hide or delete fields because I don't know their index.
Yes you will need to have the fields you want to hide as a global variables.
You will also need to get the value the user has selected and use that to work out what fields should be removed or added.
One way would be to add all the fields in order to a vector or an array when the screen is initialised. Once the user has selected a value you could iterate through the fields and use the current index of the list and the user selected value to work out if the field should be removed or added.
If you have the field objects, then use Field.getIndex() to find the index of each field within its manager.
how can i make a TRibbonComboBox act like a TCombobox with Style of csDropDownList? we don't want the user to be able to edit the choices in the list.
we need to use TRibbonComboBox because we want the current selection to be visible.
Microsoft word shows a combobox where you can select an item but cannot edit the item itself.
should i consider trying a TCombobox in the ribbon? i'd expect it won't look or not work correctly.
thank you for you comments!
You can just use TRibbonComboBox.ReadOnly:
Determines whether the user can change the text of the edit control.
And furthermore:
Setting ReadOnly to true ensures that the text is not altered, while still allowing the user to select text. The selected text can then be manipulated by the application, or copied to the Clipboard.
(see documentation)