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

gridview tabindex in cell controls

2 Answers 192 Views
GridView
This is a migrated thread and some comments may be shown as answers.
matias
Top achievements
Rank 1
matias asked on 01 Oct 2009, 05:05 PM
hello, i am using  gridview with mvvm pattern and binding
i use columns like this to build my grid:

<telerik:GridViewColumn IsSortable="False" HeaderText="Amount"
                        <telerik:GridViewColumn.CellStyle> 
                            <Style TargetType="telerik:GridViewCell"
                                <Setter Property="Template"
                                    <Setter.Value> 
                                        <ControlTemplate TargetType="telerik:GridViewCell"
                                            <StackPanel> 
                                                <TextBox PreviewKeyDown="TextBox_PreviewKeyDown" HorizontalAlignment="Stretch" 
                                                         Margin="3" VerticalAlignment="Center" 
                                                         Text="{Binding Path=Amount, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></TextBox> 
                                            </StackPanel> 
                                        </ControlTemplate> 
                                    </Setter.Value> 
                                </Setter> 
                            </Style> 
                        </telerik:GridViewColumn.CellStyle> 
                    </telerik:GridViewColumn> 


the problem is i canĀ“t set tab index to my controls (textboxes), i want to press tab and move to my textbox, how can i do so?
when i press tab i get focus in the cell not in my textbox

2 Answers, 1 is accepted

Sort by
0
Nedyalko Nikolov
Telerik team
answered on 06 Oct 2009, 08:08 AM
Hi matias,

Indeed there are some issues with Tab navigation when GridViewCell contains different objects which should get focus. We are doing our best to fix it for the next official release (2009.Q3).

Meanwhile you can take some advantages from the WPF platform and to hook for the GridViewCell.GotFocus event via EventSetter in the GridVIewCell style in the xaml code.

I'm attaching a sample project which demonstrates this approach.

Sincerely yours,
Nedyalko Nikolov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
matias
Top achievements
Rank 1
answered on 06 Oct 2009, 12:33 PM
thx, anyway, i`ve solved it setting focusable = false on cell style, so focus gets in its controls

                        <telerik:GridViewColumn.CellStyle>
                            <Style TargetType="telerik:GridViewCell">
                                <Setter Property="Focusable" Value="False"></Setter>
Tags
GridView
Asked by
matias
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
matias
Top achievements
Rank 1
Share this question
or