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

Unable to deselect selected row in Extended selection mode

1 Answer 185 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 11 Apr 2017, 11:50 AM

Hi, 

I have strange behaviour which is different from the current demo.

I have a bound grid with SelectionMode=Extended.  I can Ctrl-Click to select a 'n' number of rows and the select as expected.  But if I then single left click on anyone of those selected rows, I would expect that row to become the only selected row.  Now that is what happens in the demo, but for me, all my selected rows remain selected.

I was using version 'WPF Q2 2013 SP 1', but then tried a newer version that I had access to via our account 'UI for WPF Q1 2015', but the problem remains.

My grid markup is as follows - any thoughts very much appreciated.  I have looked and tried numerous things after reading similar style threads here, but nothing is helping.

<telerikGridView:RadGridView                                                 
                            HorizontalAlignment="Stretch" 
                            Margin="3"
                            Grid.RowSpan=" 2"
                            MinHeight ="50"
                            Height="Auto"
                            x:Name="radStandardGrid"
                            VerticalAlignment="Stretch"
                            AutoGenerateColumns="False" 
                            ShowGroupPanel="False"
                            CanUserInsertRows="False"
                            CanUserDeleteRows="False"
                            CanUserReorderColumns="False"
                            HorizontalContentAlignment="Stretch"
                            ScrollViewer.IsDeferredScrollingEnabled="True"
                            ScrollViewer.VerticalScrollBarVisibility="Auto"
                            ScrollViewer.HorizontalScrollBarVisibility="Auto"
                            VirtualizingStackPanel.IsVirtualizing="True"
                            VirtualizingStackPanel.VirtualizationMode="Recycling"
                            RowIndicatorVisibility="Collapsed"
                            CanUserFreezeColumns="False"
                            AreRowDetailsFrozen="False"
                            IsEnabled="True"
                            IsReadOnly="True"
                            ItemsSource="{Binding VirtualGridView}"
                            Sorting="radStandardGrid_Sorting"
                            SelectionChanging="radStandardGrid_SelectionChanging"
                            ScrollMode="Deferred"
                            RowActivated="radStandardGrid_RowActivated"
                            Keyboard.PreviewKeyDown="StandardGrid_PreviewKeyDown"
                            Keyboard.PreviewKeyUp="StandardGrid_PreviewKeyUp"
                            MouseRightButtonUp="StandardGrid_MouseRightButtonUp"
                            SelectionMode="Extended"
                            RowStyle="{StaticResource UnfocusedGridViewStyle}">

1 Answer, 1 is accepted

Sort by
0
Mark
Top achievements
Rank 1
answered on 12 Apr 2017, 09:48 AM
Fixed. It would appear I had some dodgy code in the SelectionChanging event that was causing this behaviour.
Tags
GridView
Asked by
Mark
Top achievements
Rank 1
Answers by
Mark
Top achievements
Rank 1
Share this question
or