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

GridView item selection on windows 8 touch

2 Answers 51 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ken
Top achievements
Rank 1
Ken asked on 22 Jan 2014, 02:54 PM
Hi,

We are using the GridView in our Silverlight apps in some master-details views. To detect selection of an item in the GridView we don't use the "SelectedItem" property, but rather subscribe to a "MouseLeftButtonUp" event on a control in the data template of the grid view cell.

This works perfectly fine when using a mouse, however, when running the app in desktop mode on a windows 8 machine and using touch (i.e. finger) to select an item in the view, it doesn't work properly. What happens is that the actual item in the GridView gets selected (selected color overlay is activated) but no MouseLeftButtonUp (or MouseLeftButtonDown) event is raised. Due to the fact that the data template of the cell is a ContentControl we can't subscribe to a Click event because it doesn't exist on ContentControl.

As far as I read on MSDN, when using touch the touch/tap events are promoted to normal mouse events. This seems to indeed be the case as the item in the grid gets selected. However, no further mouse button events are raised to our code.

Any ideas how to fix this?

Thanks,
Adrian

2 Answers, 1 is accepted

Sort by
0
Vera
Telerik team
answered on 24 Jan 2014, 04:12 PM
Hi Adrian,

Usually, clicking on a control in the GridView is handled by mouse only. In order to be able to fire the mouse events with touch, you have to set TouchManager.IsTouchHitTestVisible to false on the control. Please set the property on the control in your data template and let me know in case you still experience any problems.
 

Regards,
Vera
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Ken
Top achievements
Rank 1
answered on 24 Jan 2014, 04:31 PM
Hi Vera,

Thanks a lot for the answer, it works :)

Have a nice weekend,
Adrian
Tags
GridView
Asked by
Ken
Top achievements
Rank 1
Answers by
Vera
Telerik team
Ken
Top achievements
Rank 1
Share this question
or