TextBlock does not grey out

429 Views Asked by At

I need to grey out the a text block in my datagrid when "CandEdit" is false and i can't figure out why my code doesnt work...

what i tried:

<DataGridTextColumn Views:FilterDataGridColumn.CanFilter="True" MinWidth="80" IsReadOnly="True" Header="Alarms" Binding="{Binding Path=AlarmName}">
                <DataGridTextColumn.ElementStyle>
                    <Style TargetType="TextBlock" >
                        <Setter Property="IsEnabled"  Value="{Binding Path=CanEdit}"/>
                    </Style>
                </DataGridTextColumn.ElementStyle>
1

There are 1 best solutions below

3
On BEST ANSWER

TextBlock is not a intractable element, it can't be edited like a TextBox, so disabling it doesn't change it's appearance by deafult. You can just set it's font color to gray if that's what you are trying to achieve.