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

Focus issue.

2 Answers 87 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Doug Cvelbar
Top achievements
Rank 1
Doug Cvelbar asked on 28 May 2010, 04:00 PM
This is related to a recent thread. I am starting a new thread because that user was able to move the control outside of a scrollview and make it work.

 When I click on the control it does not receive focus (ie. the caret does not show up and I cannot type in the box.). If I right click and then left click in the textbox I can get the caret to show up and then type data. The textbox is in a scrollview and I can't just take it out. Our current structure requires it to live in the scrollview.

I am going to try to work around this with event handling and code.

2 Answers, 1 is accepted

Sort by
0
Doug Cvelbar
Top achievements
Rank 1
answered on 28 May 2010, 04:42 PM

I was able to make the rich text control react as desired by adding the following even handlers:

 

 

 

private void rtArea_GotFocus(object sender, RoutedEventArgs e)

 

{

     rtArea.UpdateEditorLayout();

}

 

 

private void rtArea_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)

 

{

     rtArea.UpdateEditorLayout();

}

Without these handlers the textbox caret does not work as you would expect. The call to UpdateEditorLayout appears to put the textbox into edit mode rather than select mode. I'm sure that is not a totally correct observation but it does resolve the issue of not seeing the caret when you click in the textbox.

0
Mike
Telerik team
answered on 31 May 2010, 08:39 AM
Hi Doug Cvelbar,

We are glad you found a solution. You can also check this thread out for another workaround:
http://www.telerik.com/community/forums/silverlight/richtextbox/strange-click-behaviour-box-disables.aspx

About the ScrollViewer (and StackPanel) - RadRichTextBox should work if you set explicitly its Width/Height.

Let us know if you need help with anything else.

Regards,
Mike
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
RichTextBox
Asked by
Doug Cvelbar
Top achievements
Rank 1
Answers by
Doug Cvelbar
Top achievements
Rank 1
Mike
Telerik team
Share this question
or