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

[Solved] Keyboard Navigation lost after editing

2 Answers 137 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Duane
Top achievements
Rank 1
Duane asked on 07 Jul 2011, 01:43 PM
Hi All,

I am using a GridView control where the user can edit the last three columns of each row.

So, there's a Check Box, a TextBox for integers, and another TextBox for notes.  When the user is editing the content in a row, the keyboard navigation works great.  But as soon as the user goes up or down, the row needs to be reselected with the mouse before keyboard navigation will work again.  Actually, once the user navigates to the uneditable portion of the row, (the first three columns), keyboard navigation is lost.

Here's the XAML markup if that would help:
<telerik:RadGridView Grid.Row="3" Name="radGridView1" AutoGenerateColumns="False"
                     ShowColumnFooters="True" 
                     telerik:RadGridViewSpellCheckHelper.IsSpellCheckingEnabled="True"
                     HorizontalAlignment="Stretch" VerticalAlignment="Stretch" 
                     IsFilteringAllowed="False" 
                     ScrollViewer.HorizontalScrollBarVisibility="Auto"
                     ScrollViewer.VerticalScrollBarVisibility="Auto"
                     ItemsSource="{Binding AuditTypeDetails, Mode=TwoWay}" 
                     IsReadOnly="{Binding IsReadOnly, Mode=OneWay}"
                       
                     RowIndicatorVisibility="Visible"
                       
                     ShowGroupPanel="False"
                     RowValidating="radGridView1_RowValidating"
                     RowValidated="radGridView1_RowValidated">
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn Header="Category" DataMemberBinding="{Binding AuditCategoryTitle}" TextWrapping="Wrap" IsReadOnly="True" Width="Auto"  />
        <telerik:GridViewDataColumn Header="Goal" DataMemberBinding="{Binding Goal}" TextWrapping="Wrap" IsReadOnly="True" Width="*" />
        <telerik:GridViewDataColumn Header="Max Points" DataMemberBinding="{Binding MaxPoints}" IsReadOnly="True" Width="Auto" >
            <telerik:GridViewDataColumn.Footer>
                <TextBlock Text="{Binding Source={StaticResource DataContextProxy}, Path=DataSource.TotalMaxPoints}" />
            </telerik:GridViewDataColumn.Footer>                            
        </telerik:GridViewDataColumn>
        <!--User Entered Values Here-->
        <telerik:GridViewDataColumn Header="Apply" Width="Auto" Background="AliceBlue">
            <telerik:GridViewDataColumn.CellTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding ApplyPoints, Converter={StaticResource boolConverter}}" />
                </DataTemplate>
            </telerik:GridViewDataColumn.CellTemplate>
            <telerik:GridViewDataColumn.CellEditTemplate>
                <DataTemplate>
                    <CheckBox x:Name="chkApplyPoints" IsChecked="{Binding ApplyPoints, Mode=TwoWay}" />
                </DataTemplate>
            </telerik:GridViewDataColumn.CellEditTemplate>                            
        </telerik:GridViewDataColumn>
        <telerik:GridViewDataColumn Header="Points Achieved" Width="Auto" DataMemberBinding="{Binding PointsAchieved, Mode=TwoWay}" Background="AliceBlue" >
            <telerik:GridViewDataColumn.CellTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding PointsAchieved}" />
                </DataTemplate>
            </telerik:GridViewDataColumn.CellTemplate>
            <telerik:GridViewDataColumn.CellEditTemplate>
                <DataTemplate>
                    <TextBox Text="{Binding PointsAchieved, Mode=TwoWay}" helpers:TextBoxFilterService.Filter="PositiveInteger" />
                </DataTemplate>
            </telerik:GridViewDataColumn.CellEditTemplate>
            <telerik:GridViewDataColumn.Footer>
                <TextBlock Text="{Binding Source={StaticResource DataContextProxy}, Path=DataSource.TotalPointsAchieved}" />
            </telerik:GridViewDataColumn.Footer>
        </telerik:GridViewDataColumn>
        <telerik:GridViewDataColumn Header="Action Plan" IsVisible="{Binding Source={StaticResource DataContextProxy}, Path=DataSource.IsActionPlanVisible}" Background="AliceBlue" >
            <telerik:GridViewColumn.CellTemplate>
                <DataTemplate>
                    <Button Command="{Binding Source={StaticResource DataContextProxy}, Path=DataSource.ActionPlanCommand}" 
                            CommandParameter="{Binding}" 
                            ToolTipService.ToolTip="Create Action Plan"
                            Width="25" Height="25">
                        <Image Source="/Audit;component/Assets/Images/Edit-32.png" />
                    </Button>
                </DataTemplate>
            </telerik:GridViewColumn.CellTemplate>                            
        </telerik:GridViewDataColumn>
        <telerik:GridViewDataColumn Header="Notes" Width="*" telerik:RadGridViewSpellCheckHelper.IsSpellCheckingEnabled="True" Background="AliceBlue" >
            <telerik:GridViewDataColumn.CellTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding Note}" Height="100" TextWrapping="Wrap" />
                </DataTemplate>
            </telerik:GridViewDataColumn.CellTemplate>
            <telerik:GridViewDataColumn.CellEditTemplate>
                <DataTemplate>
                    <TextBox Text="{Binding Note, Mode=TwoWay}" Height="100" AcceptsReturn="True" TextWrapping="Wrap" />
                </DataTemplate>
            </telerik:GridViewDataColumn.CellEditTemplate>
        </telerik:GridViewDataColumn>
    </telerik:RadGridView.Columns>                    
</telerik:RadGridView>

Thanks,
Duane

2 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 12 Jul 2011, 12:16 PM
Hi Duane,

I have tried to reproduce the issue you reported, but unfortunately without any success. Please take a look at the sample attached to verify whether there are any misunderstandings.
 

Kind regards,
Maya
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Duane
Top achievements
Rank 1
answered on 12 Jul 2011, 03:08 PM
Hi Maya,

Your example works great!

I need to refactor how I'm validating and saving the record.

Thanks!!!

[Edit]
I found my problem.  I was setting the "IsBusy" flag to true while saving the record.  Getting rid of that fixed the issue.

Thanks again!!!
Tags
GridView
Asked by
Duane
Top achievements
Rank 1
Answers by
Maya
Telerik team
Duane
Top achievements
Rank 1
Share this question
or