I have a WinForms application with a grid with TimeSlotUIElement or HourUIElement elements. The problem that I have is, when I do an action with the right click of mouse, the type of the UIElement (that I capture with UltradayView.UIElement.ElementFromPoint(e.Location)) is TimeSlotUIElement or HourUIElement, no problem about this.
But, when I do the same touching the screen of my laptop, the type of UIElement is PressAndHoldUIElement and I don't know how can look or how I can find if the selection is TimeSlotUIElement or HourUIElement.
I hope that you understand me.
I use the Infragistics 14.1
I have been investigating into the behavior you are reporting, and I cannot seem to reproduce the behavior you are seeing. On mouse click or touch of the UltraDayView, I am always receiving either a TimeSlotUIElement, HourUIElement, or MinutesUIElement. I have not run into a scenario yet where a “PressAndHoldUIElement” appears.
I have been testing using the MouseClick event of the UltraDayView against version 14.1.20141.2178 of Infragistics for Windows Forms 2014 Volume 1, as I am unsure of the exact event that you are using in this case. I am attaching the sample project I have used to test this. Please test this on your machine, as the way it behaves may help to narrow the cause of this issue down a bit further.
It is also worth noting that upon searching our API, our source code, and Google, I am not able to find any trace of a “PressAndHoldUIElement” class. By chance, are you using a CreationFilter or DrawFilter for your UltraDayView in this case?
Please let me know if you have any other questions or concerns on this matter.
I look your code and the only think I see new for me it's the "EnableGestures". When I set to true in my project and continue debugging, the result is the same.
I use the "MouseDown" event, so that's correct.
So, I take a picture to see my result, maybe knows whats the problem :/
I am pretty sure that this is a bug in the version of the controls you are using. The PressAndHoldIndicatorUIElement returns false from WantsInputNotification, so it should be ignored by ElementFromPoint. But that change was made in 2015, so it was probably still broken in v14.1.It's possible that this is fixed in the latest service release of v14.1. I can't be sure. But that would explain why Andrew's sample works correctly for him (since he is presumably using the latest service release in his testing) and does not work for you (since you are presumably not).
So I recommend that you get the latest service release and see if that helps.