Ticket T1276555
Visible to All Users

how to change opacity of disabled GridControl Rows

created 2 months ago

Hello support,

when i disable rows in a GridControl, they appear to have lower opacity.
How can i change the opacity?
A simple style setter is not working:

XAML
<dxg:TableView> <dxg:TableView.RowStyle> <Style TargetType="dxg:RowControl"> <Setter Property="ToolTipService.ShowOnDisabled" Value="True" /> <Setter Property="ToolTip" Value="disabled" /> <Setter Property="IsEnabled" Value="False" /> <Setter Property="Opacity" Value="1" /> </Style> </dxg:TableView.RowStyle> <dxg:TableView.FormatConditions> <dxg:FormatCondition Expression="true" PredefinedFormatName="StrikethroughText" /> </dxg:TableView.FormatConditions> </dxg:TableView>

Clipboard-File-1.png

Answers approved by DevExpress Support

created 2 months ago

Hello Norman,

Thank you for the sample project.

The most straightforward way to accomplish this task is to make cells read-only instead of disabling the row control:

XAML
<dxg:TableView.CellStyle> <Style TargetType="dxg:LightweightCellEditor"> <Setter Property="ReadOnly" Value="True" /> </Style> </dxg:TableView.CellStyle>

Please let me know if this meets your requirements.

Regards,
Alexander

    Show previous comments (1)
    DevExpress Support Team 2 months ago

      Hello Norman,

      Thank you for keeping us updated.

      After inspecting the application with the Snoop tool, I discovered that the opacity of the target editor can be affected via the EditorOpacity property. For this, it should be sufficient to implement a custom CellStyle as follows:

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

      Please try a similar approach and let me know if it works for you.

      See also: Troubleshooting > Snoop

      Regards,
      Paul G.

        Hello Paul,
        thank you very much for the solution and for the Snoop-Explanation.

        DevExpress Support Team 2 months ago

          You are always welcome, Norman.

          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.