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

Inconsistent Enter key handling between "FullRow" and "Cell" or "Mixed" selection units

8 Answers 123 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ireney
Top achievements
Rank 1
Ireney asked on 10 Dec 2015, 11:05 PM

I'm running into various issues with buggy behaviour between row and cell selection units.  To start with, when cell is in view mode and SelectionUnit="FullRow", pressing "Enter" keys moves to the cell below ... perfect!  However, if SelectionUnit="Cell" pressing "Enter" does nothing. Is this a known bug?  I wired up a custom keyboard command provider to see what commands are being generated, and sure enough, I see 3 commands queued up: Activate, MoveDown, and Select the current unit. However, they are not actually invoked, or fail at some point, if they are invoked.

This behaves as expected when cell is in edit mode.

8 Answers, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 15 Dec 2015, 01:09 PM
Hello ,

We're unaware of such issues and I couldn't replicate them. I actually tested this in our Selection example and keyboard navigation is working fine for me after changing the settings. Could you please try this out in the demo and let me know whether it works for you? 

The only thing I can think of is that if the focus is not in the RadGridView control, the commands wouldn't trigger. However, in that case, you shouldn't be hitting the ProvideCommandsForKey method in your custom provider either, so I suppose something else is causing the issue on your end.

If possible, could you try isolating this in a sample project and send it over? Please also share the exact version of Telerik UI for WPF that you're using.

Regards,
Petya
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
Ireney
Top achievements
Rank 1
answered on 24 Dec 2015, 12:28 AM

Hi Petya,

Unfortunately, your demo requires internet connection. Our development machines do not have internet access, and I am unable to install the necessary bits to run the demo on the shared Internet-connected machine I am posting from.

However, I tried this with the XAML SDK I downloaded from GitHub and experienced the same behavior with its samples (ColumnSelection_WPF, for instance). Perhaps the issue lies with a bug in the particular version of Telerik UI I am using.

I've been evaluating your component suite and I am currently running into this problem with WPF Q3 2015 trial version (2015.3.930.45). I have a little evaluation/sample project which includes and references those binaries, but I'm not sure how I can send this over to you, considering only image types are allowed to be attached on this forum.

Additionally, it seems that when I use the "Cell" SelectionUnit, I am unable to get a valid CurrentCell.  You can see this in my test project and custom keyboard provider or custom keyboard navigation behavior I am using. CurrentCell will be null, unless I click on a few random cells first, and then CurrentCell will behave as expected.

0
Dilyan Traykov
Telerik team
answered on 28 Dec 2015, 03:49 PM
Hello Ireney,

It seems that this behaviour was fixed in the latest service pack as can be seen here.

So I can simply suggest you update your controls to the latest version and see how it goes.
Please let us know if you're satisfied with the fix.

Regards,
Dilyan Traykov
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
Ireney
Top achievements
Rank 1
answered on 29 Dec 2015, 07:54 PM

Thanks for your response, Dilyan. This really doesn't really address the problem.  I now reference the latest service pack assemblies (2015.3.1104.45). When the grid is populated, and I select a cell, 'Enter' key still has not effect, and the CurrentCell is still null when I attempt to retrieve it in my custom keyboard provider, as per my earlier message.

However, it works fine if I click on the cell again, and it doesn't have to be the same cell.  I am able to consistently reproduce this behavior.  If I click twice on the cell after the app loads, things work fine. If I only click once, it does not work.  It seems I need to click twice to set the focus on the cell. This is also visually identifiable as the border of the selected cell changes when it is actually in focus.

Now, to make things a little more interesting, it appears that the issue manifests itself when I bind a ListCollectionView to the grid:

IList data = NumericIdoOfSomeSorts.GetData(m_numberOfRecords);
ListCollectionView view = new ListCollectionView(data);
telerikGrid.ItemsSource = view;

It works fine if I just bind to data, which is actually an ObservableCollection, like this:

IList data = NumericIdoOfSomeSorts.GetData(m_numberOfRecords);
telerikGrid.ItemsSource = data;

 

So it seems your grid has a problem/bug handling ListCollectionView consistetly.

 

0
Dilyan Traykov
Telerik team
answered on 30 Dec 2015, 11:41 AM
Hi,

I tried to reproduce your scenario but the Enter key seems to behave as expected on my side, even with a ListCollectionView. The only possible issue I saw can be fixed by setting the IsSynchronizedWithCurrentItem property of the GridView to True to keep the SelectedItem synchronized with the current item in the Items property.

Can you please have a look at the provided project and let me know if I am missing something?

Regards,
Dilyan Traykov
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
Ireney
Top achievements
Rank 1
answered on 30 Dec 2015, 07:33 PM

Ah, I have narrowed it down, Dilyan.  It seems I've found an edge case.

In the sample you've sent me, set the SelectionMode="Extended" and remove the IsSynchronizedWithCurrentItem altogether.  Markup now should look like this:

<telerik:RadGridView Grid.Row="0"
                     Name="clubsGrid"
                     AutoGenerateColumns="False"
                     Margin="5"
                     SelectionUnit="Cell"
                     SelectionMode="Extended"
                     IsSynchronizedWithCurrentItem="False">
    <telerik:RadGridView.Columns>
 

Note, that when the app loads the entire row is selected, and clicking on a cell does not actually set it in focus. Click again, and it will focus.  This is the same behaviour that I see in my one proof of concept app.  However, setting the IsSynchronizedWithCurrentItem to any value, whether true or false, fixes this and grid behaves as expected.

So, setting IsSynchronizedWithCurrentItem to any value produces the desired behavior, but this still looks like a bug. The combination of "Extended" selection mode and usage of ListCollectionView appears to be the primary culprit.

0
Ireney
Top achievements
Rank 1
answered on 30 Dec 2015, 07:37 PM

Sorry, the code snippet in my previous messages should actually look like this:

<telerik:RadGridView Grid.Row="0"
                     Name="clubsGrid"
                     AutoGenerateColumns="False"
                     Margin="5"
                     SelectionUnit="Cell"
                     SelectionMode="Extended">

0
Accepted
Dilyan Traykov
Telerik team
answered on 04 Jan 2016, 12:52 PM
Hello ,

Yes, it does seem like a bug and I will report it as such. As a thank you for your help, I've awarded you with some Telerik points.

I've created a new item in our Feedback Portal which you can follow here.
In the meantime, I hope the workaround with setting IsSynchronizedWithCurrentItem works for you.

Regards,
Dilyan Traykov
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
Tags
GridView
Asked by
Ireney
Top achievements
Rank 1
Answers by
Petya
Telerik team
Ireney
Top achievements
Rank 1
Dilyan Traykov
Telerik team
Share this question
or