Touch Support in NetAdvantage for ASP.NET 12.1

Jordan Tsankov / Wednesday, July 25, 2012

We , the people of today , have mobility rooted deeply into our lives. We are constantly on the move , be it due to work routines or leisure activities. We are also used to being surrounded by high-tech gadgetry – it helps us in our everyday tasks and brings entertainment right at our fingertips , literally. Along came a new way of interacting with devices: enter touch screen. It brought the traditional way of “pointing at” and “touching” things we desire back to a field where peripheral devices were a must. Surely , “mobile” is the new hype and it has settled in for a long ride.

In compliance with this , the 12.1 release of NetAdvantage for ASP.NET brings touch support to the table for every control in the package ( of course , this means the controls that can be interacted with ). As of 12.1 , you should expect the controls to behave very similarly ( sometimes even identically ) on a PC and a mobile device with touch screen. 

What this means for you as a developer is that all of your future ASP.NET projects will be tablet-ready , with the controls being able to handle all the corresponding touch device events. While we’re on this subject , I’ll elaborate on what issues you will run into ( and why ) when giving your controls a test drive under a touch environment.

Drag & Drop – there isn’t any. This is not good news , not at all , but there is a good explanation for this one. The default action of a touch device when subjected to a hold-and-move motion ( which is exactly how you would expect to perform a drag and drop on such a device ) is to scroll in the moved direction.

The lack of drag & drop means you’re left without column reordering in the Data Grid and Hierarchical Data Grid – well , it’s there but it won’t work in the conventional way. You will be able to utilize this behavior using the code behind. The same applies for the group by feature. No drag & drop also means you would be better off not to count on the splitter as it is a control that ( unless used for collapsing and expanding page segments ) is entirely reliant on this feature.

Selections – be aware that when working with controls that support multiple selections , this will not function properly on a touch device. To understand why this is so , let’s think about how we select a group of things on a computer.

  • Drawing a selection rectangle over the desired items – this breaks down to us clicking and holding at the top left point of the desired rectangle and dragging the pointer towards the bottom right point. As we’ve covered in the section above that is about drag & drop , when we try to repeat the same actions on a touch device we will end up with a scroll gesture being performed.
  • Using the shift and control key modifiers. The shift key lets us specify a from-to range of items whereas control is for a finer selection of multiple items. Well , the issue here is obvious – having these two keys on a device with a touch screen would kill the purpose of a touch screen.

WebVideoPlayer – it’s worth mentioning that the video player will try to fall back to the default device video player if the Modernizr Javascript library is undefined on your page. If , however , you have the library loaded up ( it’s a requirement for the video player to be rendered correctly ) then you will get the WebVideoPlayer , themed accordingly and with all the options coming with it.

 

With these differences aside , the controls should be performing in similar matter as when interacted with on a PC. Why don’t you try it out and head over to the NetAdvantage for ASP.NET samples page on your tablet and check out how specific controls work.