We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Get cursor/caret position/information

Thread ID:

Created:

Updated:

Platform:

Replies:

116587 Jun 12,2014 01:19 PM UTC Jun 13,2014 09:32 AM UTC WinRT 5
loading
Tags: SfRichTextBoxAdv
Kurt Farrar
Asked On June 12, 2014 01:19 PM UTC

Hi there,

I'm continuing development of my application to annotate to documents in WinRT. We need to be able to access the current cursor position so that we can record the point that a comment can be inserted and then later amend the source document to insert the actual comment.

I understand that the RichTextBoxAdv control doesn't handle the input and displaying of comments and this is fine, I simply need to be able to hold some information about the current cursor position from where the user has tapped or clicked on the document. Ideally page, paragraph, section, word or character, but anything would be better than nothing.

Any help that you can provide would be greatly appreciated,

Thanks,

Kurt


Arumuga Perumal S [Syncfusion]
Replied On June 12, 2014 01:36 PM UTC

Hi Kurt,

Thank you for your interest in Syncfusion products.

In our SfRichTextBoxAdv control , it is possible to obtain the current cursor position and current paragraph whenever we tapped or clicked on the document by hooking the SelectionChanged event. We have mentioned the sample code snippet for the same below.

Hooking selection changed event of SfRichTextBoxAdv control:
richtextbox.SelectionChanged += richtextbox_SelectionChanged;

Retrieving current cursor position:
void richtextbox_SelectionChanged(object obj, Syncfusion.UI.Xaml.RichTextBoxAdv.SelectionChangedEventArgs args)

{

     TextPosition position = richtextbox.Selection.Start;

     ParagraphAdv paragraph = position.Paragraph;

}


Please let us know if you have any other questions.

Regards,
Arumuga Perumal S.


Kurt Farrar
Replied On June 12, 2014 01:42 PM UTC

Many thanks for your speedy reply. Is that event new to v12 of the controls?

I'm currently running v11.3.x and don't see it.


Arumuga Perumal S [Syncfusion]
Replied On June 13, 2014 03:44 AM UTC

Hi Kurt,

Thank you for your update.

Yes, the SelectionChanged event is available from Essential studio v12.1 and is available for download under the following link.

http://www.syncfusion.com/support/forums/announcements/116142.

Please let us know if you have any other questions.

Regards,
Arumuga Perumal S.


Kurt Farrar
Replied On June 13, 2014 07:43 AM UTC

Thanks, I got a trial of the latest version to check myself yesterday, and have bought the latest version of the controls since.

Arumuga Perumal S [Syncfusion]
Replied On June 13, 2014 09:32 AM UTC

Hi Kurt,

Thank you for your update.

Please let us know if you have any other questions.

Regards,
Arumuga Perumal S.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;