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

IsSynchronizedWithCurrentItem="True" with extended(multiple) row selection

4 Answers 204 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Christoph
Top achievements
Rank 1
Christoph asked on 16 Aug 2011, 09:15 AM
When I set IsSynchronizedWithCurrentItem="True", the current row gets the row selection indicator (chevron). However, I have extended selection enabled - to be able to Ctrl+Click-add multiple rows. In this case, only the first row I select gets the chevron - is there a way to extend this to all selected items? (or restyle the area where the chevron is displayed entirely)

Chris

4 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 16 Aug 2011, 09:41 AM
Hello Christoph,

 

Indeed a possible approach in this case is to predefine the template of GridViewRow and modify its Selected State as follows:

<MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsSelected" Value="True"/>
                                    <Condition Property="DisplayVisualCues" Value="True"/>
                                </MultiTrigger.Conditions>
                                <Setter Property="Visibility" TargetName="NavigatorIndicator" Value="Visible"/>
                                <Setter Property="Visibility" TargetName="Background_Selected" Value="Visible"/>
                                <Setter Property="Background" TargetName="NavigatorIndicatorBackground">
                                    <Setter.Value>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="White" Offset="0"/>
                                            <GradientStop Color="#FFE4E4E4" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                            </MultiTrigger>
                            <MultiTrigger>


Then when you select multiple rows you would be able to see the NavigatorIcon path in each row. 


If you need any further assistance do not hesitate to contact us!



Regards,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Christoph
Top achievements
Rank 1
answered on 16 Aug 2011, 09:48 AM
I am bit at a loss what exactly you pasted here - was this from a template or a style customized with Blend or... what I am asking for is the surrounding XAML to know where this would have to go.

Thanks,
 Chris
0
Vanya Pavlova
Telerik team
answered on 16 Aug 2011, 09:57 AM
Hi Christoph,

 

Yes, the code-snippet is part of the extracted template of GridViewRow using Expression Blend.
I am attaching you sample project which demonstrates the proposed solution. 


Greetings,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Christoph
Top achievements
Rank 1
answered on 16 Aug 2011, 10:36 AM
It works - however, one thing needs to be corrected in the sample (when you copy/paste the style):

DataContext="{Binding Source={StaticResource SampleDataSource}}

to

DataContext="{TemplateBinding DataContext}

Chris
Tags
GridView
Asked by
Christoph
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Christoph
Top achievements
Rank 1
Share this question
or