This is a migrated thread and some comments may be shown as answers.

RadRichTextBox cursor and contextual menu.

7 Answers 135 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Greg
Top achievements
Rank 1
Greg asked on 16 Sep 2012, 01:43 PM
Hello,

I've got a few questions regarding the RadRichTextBox.

1. How can I make the IBeam cursor display only within the editable area of the text box, but not on the scroll bars as well?

2. I see that the rich text box doesn't come with a default Copy/Cut/Paste contextual menu. How would I go about implementing a standard contextual menu with working cut/copy/paste functions, and how would I display it.

If you are kind to answer these questions, please tell me how to solve the problems using C# code, and not XAML.

Thank you!

7 Answers, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 17 Sep 2012, 04:03 PM
Hello Greg,

Please, find the answers to your questions below:
  1. By default the I-beam cursor is displayed only in editable areas. This is the behavior we are observing on our end. I am also attaching a screenshot demonstrating this in our WPF demos. This said, have you done something differently? Are you observing this issue in a application of your own or are you running the demos as well?
  2. A standard ContextMenu is provided out of the box, though it can be easily customized or replaced. As stated here, you'd have to reference the Telerik.Windows.Controls.RichTextBoxUI assembly in order to use all pop-ups, including ContextMenu. You can also find ways to customize the context menu in this article.
Please, do not hesitate to get back to us if you have additional questions!

All the best,
Petya
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
Greg
Top achievements
Rank 1
answered on 17 Sep 2012, 04:45 PM
Hello Petya and thank you for your assistance.

1. Regarding the RichTextBox, I haven't done anything special to it (I only dropped the control on a grid). It just doesn't display the IBeam in the editable area. If I explicitly tell the RichTextBox instance to use the IBeam cursor, then it will show it everywhere in the box (even when hovering over scroll bars).
In the Telerik Editor demo, you are right, the cursor shows the IBeam in the editable area, but in my case the cursor behaves just like in the Document API example, even if the RichTextBox is editable.

2. Thank you for the information about the context menu. It has helped me.
0
Petya
Telerik team
answered on 19 Sep 2012, 03:47 PM
Hi Greg,

Thank you for the follow-up.

We found out that when the LayoutMode of RadRichTextBox is set to Flow or FlowNoWrap there is some unexpected behavior regarding the cursor. Is this also your case? If so, we logged the issue and will try to fix it for one of our future releases.

Other than that, the way the cursor is shown in different parts of the editor and its document depends on a rather complicated logic. That said, I would not recommend you to override this logic by explicitly changing the cursor.

Please, excuse us for any inconvenience this may be causing you.

 
Regards,
Petya
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
Greg
Top achievements
Rank 1
answered on 19 Sep 2012, 04:06 PM
Hello,

While I would like to set the rich text box to FlowNoWrap, I do not get an IBeam cursor even if I just drop a RadRichTextBox on the grid:
<Grid x:Name="LayoutRoot">
<
telerik:RadRichTextBox Margin="200,100,200,200"/>
</
Grid>

If it is possible, please send me a project where it works for you so I can test it on my machine.

Thank you again for your assistance.
0
Petya
Telerik team
answered on 21 Sep 2012, 12:04 PM
Hi Greg,

Please, excuse me for not being clearer before.

As you can read here, RadRichTextBox has three layout modes - Flow, FlowNoWrap and Paged. The default mode is Flow and the issue you have reported is present for Flow and FlowNoWrap modes. This is the reason why you are observing such behavior when you haven't set any settings.

The cursor shows correctly in Paged layout mode, you could try it with a RadRichTextBox like the following:
<telerik:RadRichTextBox Name="editor" LayoutMode="Paged" />

Get back to us if you have other comments or questions.

Kind regards,
Petya
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
Greg
Top achievements
Rank 1
answered on 21 Sep 2012, 12:19 PM
Ah, I see now. You are right.

Until the Flow layouts get fixed, what settings would you recommend for the Paged layout mode so that it resembles as much as possible with the Flow layouts?
0
Vasil
Telerik team
answered on 26 Sep 2012, 02:27 PM
Hi Greg,

Thank you for getting back to us.

Fortunately, we have managed to resolve the issue that when the LayoutMode of RadRichTextBox is set to Flow or FlowNoWrap, the cursor is not IBeam. The fix will be included in the next internal build expected in the beginning of next week, as well as the next official release - 2012 Q3 - due next month.

About your question, there is no easy way to customize the template of the rich text box when in paged layout mode to resemble that of flow. We suggest that you download and use the Internal Build once it is published.

I hope this information helps.

Regards,
Vasil
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

Tags
RichTextBox
Asked by
Greg
Top achievements
Rank 1
Answers by
Petya
Telerik team
Greg
Top achievements
Rank 1
Vasil
Telerik team
Share this question
or