1. To change the background (Fill) color of the ComboBox to be different depending on whether it's in Edit mode or New mode-
Select the ComboBox inside the DataCard.
Go to the Fill property of the ComboBox.
Use below code.
If(
Parent.DisplayMode = DisplayMode.Edit,
ColorValue("White"), // Fill color for Edit mode
ColorValue("LightGray") // Fill color for other modes
)
2. To change the text color of the ComboBox to change to Gray when the DataCard is disabled-
Select the ComboBox inside the DataCard.
Go to the Color property of the ComboBox.
Use below code.
If(
Parent.DisplayMode = DisplayMode.Disabled,
ColorValue("Gray"), // Text color for Disabled mode
ColorValue("Black") // Text color for Edit or View mode
)
3. If the Fill property of the DataCard doesn’t apply, unlock the DataCard and control its behavior manually-
Unlock the DataCard
Select the DataCard.
Go to the Advanced Properties panel.
Click Unlock.
To ensure the background color applies select the DataCard itself.
Set its Fill property to this code:
If(
DisplayMode = DisplayMode.Disabled,
ColorValue("LightGray"), // Disabled mode color
ColorValue("White") // Default color
)
4. Customizing ComboBox Appearance When Disabled,
If you want the ComboBox to look better when disabled and cannot directly apply Fill or Color effectively-
Add a Rectangle shape on top of the ComboBox.
Set the Fill of the Rectangle to:
If(
Parent.DisplayMode = DisplayMode.Disabled,
RGBA(211, 211, 211, 0.5), // LightGray with transparency
RGBA(0, 0, 0, 0) // Fully transparent
)
Adjust the Z-Order to keep the ComboBox interactive when not disabled.