I am trying to show a long document (a terms and conditions statement) on a readonly XamRichTextEditor. It is going to be on a Kiosk application so without mouse and keyboard. I want the user to be able to swipe down the screen on the XamRichTextEditor control which will scroll the XamRichTextEditor down. So if the user swiped quickly down it would scroll the XamRichTextEditor control down. Similarly to how you operate a mobile device when scrolling quickly down the screen. As it's difficult to operate the scrollbar on a touchscreen and I want the user to be able to quickly peruse/move through the document.
Not sure if I should use a different control rather than the XamRichTextEditor ?
Thanks.Dave
Hello,
I am glad that you find my suggestion helpful.
Thank you for using Infragistics components.
Regards,Teodosia HristodorovaAssociate Software Developer
Hi Teodosia, I just pasted the scrollviewer on from your example and it worked really nicely, thank you so much!
Thanks Teodosia, However your sample is exactly the same as the old one? Dave
I have been looking into your questions and having in mind we don't have explicit touch support in the XamRichTextEditor, the default Windows behavior for handling touch events will prevail. In order to prevent the selection, you could handle the SelectionChanged event of the editor and set the event argument DocumentView.Selection range to (0, 0).
However, a better approach I could suggest is to use the ScrollViewer provided by the .NET Framework :
<ScrollViewer PanningMode="VerticalOnly" CanContentScroll="True" > <ig:XamRichTextEditor Name="xrte1" IsReadOnly="True" > <ig:XamRichTextEditor.Document> <ig:RichTextDocument > </ig:RichTextDocument> </ig:XamRichTextEditor.Document> </ig:XamRichTextEditor> </ScrollViewer>
In order to enable the default touch scrolling behavior you could set the ScrollViewer's PanningMode property to value different than its defult which is None. More about this property could be found here.
Additionally, properties that you might consider useful are PanningDeceleration and PanningRatio. As it is mentioned in the Microsoft documentation the PanningRatio property sets the ratio of scrolling offset to translate manipulation offset. Its default value is 1. The PanningDeceleration property specifies the rate the scrolling slows after the user lifts the finger.
I have modified the previously attached sample below. Please test it on your side and let me know if I may be of any further assistance.
Sincerely,
Teodosia Hristodorova
Associate Software Developer
2816.XRTE_scroll_on_touch.zip
Thank you Teodosia, is there anyway to prevent the text being selected as you swipe? Also is there anyway for it to scroll quicker depending on how quickly you swipe?
Many thanks.Dave