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

Problem Selecting row in a radGridview with touchscreen

2 Answers 288 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Serena
Top achievements
Rank 1
Serena asked on 21 Jun 2017, 01:18 PM

Hello I have a problem selecting rows in a Radgrid with TOUCHSCREEN. At the start, one row is selected (the blue one, as you can see in the screenshot), but when I click on another row nothing happens (I just see small little circus that I'm tapping on the screen). Everythings works fine if I use a mouse attached to the tablet but doesn't work if I use finger on touchscreen. The desired result is that the row "touched" becomes blue and is the SelectedItem="{Binding SelectedItuGrid.

Just to let you know that the radiobutton and the Button X works with touch after I added this instruction:  telerik:TouchManager.IsTouchHitTestVisible ="False"   

 

This is the XAML code:

<StackPanel Grid.Row="4" telerik:TouchManager.IsTouchHitTestVisible ="False" >
                            <telerik:RadGridView x:Name="radGridUti"
                            SelectedItem="{Binding SelectedItuGrid, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"                                
                            telerik:TouchManager.IsTouchHitTestVisible ="False"   
                            telerik:ScrollingSettingsBehavior.IsEnabled="True"
                            IsReadOnly="True"
                            SelectionMode="Single"                         
                            SelectionUnit="FullRow"                                                  
                            ShowColumnSortIndexes="False"                                
ItemsSource="{Binding ItusSameGroupList, Mode=TwoWay}"                            
                            Visibility="{Binding GridItusSameGroupVisibility}"
                            Margin="0,10,0,10" >
                                <telerik:RadGridView.Columns>
                                    <telerik:GridViewDataColumn t:I18N.Translate="ITU Id" DataMemberBinding="{Binding UtiId}" Width="0" IsVisible="False" />
                                    <telerik:GridViewDataColumn t:I18N.Translate="ITU Plate" DataMemberBinding="{Binding UtiPlate}" Width="3*" />
                                    <telerik:GridViewDataColumn t:I18N.Translate="Ground" Width="3*" HeaderTextAlignment="Center">
                                        <telerik:GridViewDataColumn.CellTemplate>
                                            <DataTemplate>
                                                <RadioButton Content="{Binding RadioButtonGround}" GroupName="{Binding UtiPlate}"
                                                            HorizontalAlignment="Center"                                                         
                                                            IsChecked="{Binding IsUtiInDoubleStakerHold, 
                                                            Converter={StaticResource EnumBoolConverter}, 
                                                            ConverterParameter={x:Static views:UtiGroundUpper.Ground}, Mode=TwoWay}"
                                                            IsEnabled="{Binding IsUtiInDoubleStakerHold, 
                                                            Converter={StaticResource EnumBoolConverter}, 
                                                            ConverterParameter={x:Static views:UtiGroundUpper.Disabled}}" />
                                            </DataTemplate>
                                        </telerik:GridViewDataColumn.CellTemplate>
                                    </telerik:GridViewDataColumn>
                                    <telerik:GridViewDataColumn t:I18N.Translate="Upper" Width="3*" HeaderTextAlignment="Center">
                                        <telerik:GridViewDataColumn.CellTemplate>
                                            <DataTemplate>
                                                <RadioButton Content="{Binding RadioButtonUpper}" 
                                                            HorizontalAlignment="Center"
                                                            GroupName="{Binding UtiPlate}"
                                                            IsChecked="{Binding IsUtiInDoubleStakerHold, 
                                                            Converter= {StaticResource EnumBoolConverter}, 
                                                            ConverterParameter={x:Static views:UtiGroundUpper.Upper}, Mode=TwoWay}"
                                                            IsEnabled="{Binding IsUtiInDoubleStakerHold, 
                                                            Converter={StaticResource EnumBoolConverter}, 
                                                            ConverterParameter={x:Static views:UtiGroundUpper.Disabled}}" />
                                            </DataTemplate>
                                        </telerik:GridViewDataColumn.CellTemplate>
                                    </telerik:GridViewDataColumn>
                                    <telerik:GridViewDataColumn Width="1*" HeaderTextAlignment="Center">
                                        <telerik:GridViewDataColumn.CellTemplate>
                                            <DataTemplate>
                                                <Button 
                                                        HorizontalAlignment="Center"                                          
                                                        Visibility="{Binding Path=DeleteCommandIsVisible, Converter={StaticResource BoolToVis}, Mode=TwoWay}"
                                                        Command="{Binding Path=DataContext.ConfirmDeleteViewCommand,
                                                    RelativeSource={RelativeSource Mode=FindAncestor,      
                                                     AncestorType={x:Type UserControl}} }" 
                                                    CommandParameter="{Binding}" 
                                                        Background="Transparent"
                                                        BorderBrush="Transparent"
                                                        Height="50"
                                                        Width="100">
                                                    <fa:ImageAwesome Icon="remove" Foreground="Red" Width="32" Height="32" VerticalAlignment="Center"  
                                                     HorizontalAlignment="Center"/>
                                                </Button>
                                            </DataTemplate>
                                        </telerik:GridViewDataColumn.CellTemplate>
                                    </telerik:GridViewDataColumn>
                                </telerik:RadGridView.Columns>
                            </telerik:RadGridView>
                        </StackPanel>

 

Please let me know,

thank you.

 

2 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 26 Jun 2017, 12:21 PM
Hello,

As I can see from the provided code snippets, you have set the IsHitTestVisible property of the GridView to False. This means that our RadGridView does not understand our internal touch events. So it can not recognize the Tap gesture which will select the row. Can please remove this property and let me know about the result? However, if you need to select the radio button which is placed in the row, you will have to set the TouchMode.None property for the radio button. This is needed otherwise RadGridView will understand the pressing over the button as Tap gesture. Please check the How To Enable Touch Events for Custom Elements for a reference.

As a side note - the IsTouchHitTestVisible property is obsolete. You can replace it with TouchMode.None. Please check the TouchManager Touch Modes help article for a reference.

Regards,
Yoan
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
0
Serena
Top achievements
Rank 1
answered on 26 Jun 2017, 01:41 PM

Hello Yoan,

thank you for your suggestion! Now everything works as expected.

 

Serena

Tags
GridView
Asked by
Serena
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Serena
Top achievements
Rank 1
Share this question
or