6 Answers, 1 is accepted
Thank you for writing.
RadRichTextEditor has a specific positioning feature to navigate through document's content and to get information about the document's elements at a specific position. RadDocument uses the positioning to track the movement of the and to control the selection. You can navigate to a specific position in the document and get the DocumentPosition.Location property. Additional information about positioning is available here: http://docs.telerik.com/devtools/winforms/richtexteditor/features/positioning
I hope this information helps. Should you have further questions I would be glad to help.
Telerik by Progress
Thanks to Respond Dess.
Actually i need the location of char by index. Like the location of 5th char of radRichTextBox in X and Y axis.
Can you please help me?
Thank you for writing back.
RadRichTextEditor doesn't provide such an API to get the position by char index directly. The possible solution is to use the DocumentPosition which should be placed at the beginning of the document and move it to the next character by the MoveToNext method. Thus, you can access the desired char's location by index. Here is a sample code snippet:
I hope this information helps. If you have any additional questions, please let me know.
Telerik by Progress
Is it possible to get the same function with a RadTextBox ?
Since I'm using a RadExpressionEditorForm, I can't change the type of the [radTextBoxExpression]...
Note that RadRichTextEditor and RadTextBox have a completely different internal elements structure. Hence, the API is different. RadTextBox also hosts the standard MS TextBox. You can refer to the following general programming forums demonstrating how to get the char value form a position (index). You can get the hosted TextBox by the RadTextBox.TextBoxElement.TextBoxItem.TextBoxControl:
I hope this information helps.
Dess | Tech Support Engineer, Sr.