Ticket T1284280
Visible to All Users

Change text color/opacity in a disabled GridControl cell.

created 4 days ago

Hi,

I need to darken the text (either setting a darker color or increasing the Opacity) of a disabled cell in a GridControl. Our users use our applications outside on a laptop and the default disabled text color is too light and washes out in the sun. I have searched the existing support tickets and found that you can override the "TextEditThemeKey ResourceKey=TextStyle" resource, but that only seems to affect editors that are not hosted in a GridControl. I have also tried to set up a style trigger to set the opacity of an InplaceBaseEdit control (which according to Snoop is the actual editor), but that doesn't work either.

I just want the text darker, the buttons, borders, and other UI elements on the control should remain the same (so basically what the TextEditThemeKey override is doing with the controls outside of a GridControl). I know you can just use ReadOnly instead, but that renders the cell exactly like the enabled state and the dropdowns still open (although you cannot change anything). I think that will confuse our users and we may get calls about it not working.

I have a sample that shows what I have so far. I would need the dropdowns (ComboBoxEdit, LookUpEdit), the DateEdit, and the base TextEdit to have darker text. If the only way to do this is to hack the theme resources, are there any drawbacks to doing that?

Thank you.

Answers approved by DevExpress Support

created 4 days ago

Hello,

We discussed a similar task in the following public ticket: T1276555 - how to change opacity of disabled GridControl Rows. In that thread, my colleague mentioned that you can use a cell style with the EditorOpacity property to accomplish this task.

XAML
<dxg:TableView.CellStyle> <Style TargetType="{x:Type dxg:LightweightCellEditor}"> <Setter Property="EditorOpacity" Value="1"/> </Style> </dxg:TableView.CellStyle>

Please let me know if this helps.

Regards,
Alexander

    Comments (2)
    BM BM
    Blair Martin 3 days ago

      Yes, this should work. Thanks a lot for your help.

      Alexander D (DevExpress Support) 3 days ago

        You are always welcome.
        Alexander

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.