This is a migrated thread and some comments may be shown as answers.

Display grid lines when disabled

2 Answers 64 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Etienne
Top achievements
Rank 1
Etienne asked on 21 May 2015, 07:23 PM

Hi,

I use Expression Dark theme with RadGridView and when the gridview is disabled, cells' border are hidden. I'm trying to display them anyway. I've been able to display vertical lines, but I can't find what to change to prevent hidding horizontal lines.

Thank you,

 Etienne

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimitrina
Telerik team
answered on 26 May 2015, 08:27 AM
Hi Etienne,

In order to modify the default behavior, you should edit the default control template of GridViewCell. To learn how to style Telerik UI for WPF you can read the common topics on Setting a Theme (Using Implicit Styles) and Editing Control Templates

As to the specific question, one way would be to comment the ObjectAnimationUsingKeyFrames code for Disabled VisualState:
<VisualStateGroup x:Name="DisabledStates">
    <VisualState x:Name="Enabled"/>
    <VisualState x:Name="Disabled">
        <Storyboard>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_ContentPresenter" Storyboard.TargetProperty="Opacity">
<DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0.3"/>
   </DoubleAnimationUsingKeyFrames>
            <!--
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background_Disabled" Storyboard.TargetProperty="Visibility">
                <DiscreteObjectKeyFrame KeyTime="0">
                    <DiscreteObjectKeyFrame.Value>
                        <Visibility>Visible</Visibility>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>            </ObjectAnimationUsingKeyFrames>-->        </Storyboard>
    </VisualState>
</VisualStateGroup>

You can find attached a demo project. Please note, I also modified the GridView_GridLinesItemBorder color to be Yellow, for a better visual representation:
<!--Color modified-->
<SolidColorBrush x:Key="GridView_GridLinesItemBorder" Color="Yellow"/>

Regards,
Dimitrina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Etienne
Top achievements
Rank 1
answered on 29 May 2015, 03:38 PM

Hi Dimitrina,

Thanks for your solution, it works great!

 Etienne

Tags
GridView
Asked by
Etienne
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Etienne
Top achievements
Rank 1
Share this question
or