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

RadGridViewCommands.MoveNext doesn't work

4 Answers 205 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Radek
Top achievements
Rank 1
Radek asked on 19 Jan 2015, 03:36 PM
Hi,

I've searched forum for information how to manipulate keyboard navigation behavior of the grid (RadGridView), and I've found a few posts. The best is here http://docs.telerik.com/devtools/silverlight/controls/radgridview/commands/KeyboardCommandProvider and http://blogs.telerik.com/xamlteam/posts/10-06-30/how---to-change-the-default-keyboard-behavior-in-radgridview-for-silverlight-wpf.aspx but focus after action MoveNext doesn't work. Focus is moved to nothing and when I click Tab key to check where is the focus it's moving to the first control (focus-able) on the screen. This works only for MoveDown but it's direction I'm not interested in. Is there some property that should be set?

Radek
I'm using version 2012.2.912.35

4 Answers, 1 is accepted

Sort by
0
Radek
Top achievements
Rank 1
answered on 20 Jan 2015, 04:44 PM
I've set GotFocus and LostFocus to print out what is happening when the framework does MoveNext or MoveDown and in both of them I receive GotFocus for the Cell (and for gird, but it's not relevant here), but only for MoveDown GotFocus is later on called on content. I start to think that maybe it's related to EditTriggers of the column? Or maybe MoveNext and MoveDown actions differ significantly. Can someone from Telerik team comment?
0
Boris
Telerik team
answered on 22 Jan 2015, 11:40 AM
Hello Radek,

In order to provide you with better guidance, could you please provide us with more details about your case and a screen-cast that illustrates the issue ?

Regards,
Boris
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Radek
Top achievements
Rank 1
answered on 22 Jan 2015, 06:07 PM
Here is xaml of the grid:
<UserControl
    x:Class="Ocean.IMD.GCB.Wpf.DynamicData.Views.DynamicGridView"
  <t:RadGridView
    ItemsSource="{Binding Items}"
    ShowGroupPanel="False"
    IsFilteringAllowed="False"
    RowIndicatorVisibility="Collapsed"
    CanUserFreezeColumns="False"
    BorderBrush="White"
    BorderThickness="0"
    VerticalGridLinesBrush="White"
    EditTriggers="CellClick"
    HorizontalAlignment="Left"
    VerticalAlignment="Top"
    HorizontalGridLinesBrush="White"
    FontFamily="Arial"
    FontSize="12"
    GridLinesVisibility="None"
    IsTabStop="False"
    BeginningEdit="GridViewDataControl_OnBeginningEdit"/>
</UserControl>

Items is holding list of rows as ObservableCollection<RowViewModel>(). RowViewModel is a model to each row with data stored as dictionary.

I've read this about ObservableCollections http://updatecontrols.net/doc/tips/common_mistakes_observablecollection and everything is done using Insert() or Add() APIs, I don't recreate the whole collection on updates.

As I said before, on the grid when I do ENTER I go to the bottom cell but when I do TAB focus goes away. Could you tell me what exactly you want to know about my code base? My project is pretty large and I don't want to copy and paste all the code.

Thanks,
Radek
0
Boris
Telerik team
answered on 27 Jan 2015, 09:51 AM
Hello Radek,

In general by using the RadGridView, you can edit the data displayed in it. The data is edited in rows by default, which means that when a row is in edit mode, you can edit all of the fields that it contains.

There are three ways for the row to enter edit mode. The first one is when the user presses F2 (or double clicks the cell), the second is when the BeginEdit() method of the RadGridView is called and the third is when the user starts typing over the cell. This behavior is controlled by the EditTriggers Enumeration either on GridView or the column level. In addition the default commands executed in view or edit mode are different for both the Tab and Enter keys.

In view mode:
1) Tab executes the MoveNext and SelectCurrentUnit commands.
2) Enter executes the ActivateRow, MoveDown and SelectCurrentUnit commands.

In edit mode:
1) Tab executes the MoveNextSelectCurrentUnit and BeginEdit commands.
2) Enter executes the CommitEditMoveDownSelectCurrentUnit and BeginEdit commands.

For more information about the meaning of the different commands you can check the Commands - Overview documentation article.

On a side note pressing the Tab or Enter keys in view or edit mode both move the focus. That is why I am not entirely sure what is the exact issue and how you need pressing of these keys to behave.

Regards,
Boris
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Radek
Top achievements
Rank 1
Answers by
Radek
Top achievements
Rank 1
Boris
Telerik team
Share this question
or