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

How to substitute GridViewIndicatorCell

1 Answer 115 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ludovic
Top achievements
Rank 1
Ludovic asked on 06 Aug 2015, 02:02 PM

Hi,

 

I used this GridViewIndicatorCell style with an old version (2012), and I updated to Q2 2014.

<ControlTemplate x:Key="GridViewIndicatorCellTemplate" TargetType="grid:GridViewIndicatorCell">
        <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
                BorderThickness="{TemplateBinding BorderThickness}">
            <ContentPresenter
                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                Margin="{TemplateBinding Padding}"
                Content="{TemplateBinding Content}" />
        </Border>
    </ControlTemplate>
    <Style x:Key="GridViewIndicatorCellStyle" TargetType="grid:GridViewIndicatorCell">
        <Setter Property="Template" Value="{StaticResource GridViewIndicatorCellTemplate}" />
        <Setter Property="Background" Value="{StaticResource GridView_RowIndicatorCellBackground}" />
        <Setter Property="BorderBrush" Value="{StaticResource ControlOuterBorder}" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="Padding" Value="0" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
    </Style>
    <Style TargetType="grid:GridViewIndicatorCell" BasedOn="{StaticResource GridViewIndicatorCellStyle}" />

 

Then a cell is selected, the background color is more colorful. But now, if my RadGridView lost the focus, the background color of the selected cell disappears. You can see on the attach files the difference between before and now.

 

I can see here that as an alternative solution, I can substitute it with a single Border element or any ContentControl. But I don't know how to do, could you help me ?

 

Thank you.

1 Answer, 1 is accepted

Sort by
0
Ludovic
Top achievements
Rank 1
answered on 06 Aug 2015, 02:35 PM

Hi,

I finally solved this issue.

I changed the code in <VisualState x:Name="SelectedUnfocused">​ of the <ControlTemplate x:Key="GridViewRowTemplate" TargetType="grid:GridViewRow">.

 

Sorry

Tags
GridView
Asked by
Ludovic
Top achievements
Rank 1
Answers by
Ludovic
Top achievements
Rank 1
Share this question
or