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

RadRichTextbox in RadDiagramShape

2 Answers 156 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 07 Apr 2012, 12:15 PM
Hello,

I have created a contentTemplate and an editTemplate for my control which inherits from RadDiagramShape. All works well with the other controls, but once I click on the RadRichTextbox in the editTemplate, the control switches back to the contentTemplate. So it is impossible to edit the text of the RadRichTextbox during runtime.

To make it more clear:
diagramItem -> editmode -> mouse click on the RadRichTextbox -> diagramitem immediately goes out of edit mode.

The RadRichTextbox has not been modified, and the control doesn't have any special events. All buttons, the watermarkTextbox and the normal Textbox work as they should.

Am I missing something or is the functionality not yet implemented in the RadDiagram component?

Regards,
James

2 Answers, 1 is accepted

Sort by
0
Accepted
Alex Fidanov
Telerik team
answered on 09 Apr 2012, 09:38 AM
Hello James,

This behavior is caused by the RadRichTextBox control handling the mouse down event and not handling the mouse up event, which respectively stops the hit testing and deselects the shape. We are currently working on resolving this. In the meantime, what you can try is to handle the PreviewEndEdit event of the RadDiagramShape class and handle it so that the shape does not exit edit mode. This needs to be done only when the rich textbox control has been hit (mouse left down).

Regards,
Alex Fidanov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
James
Top achievements
Rank 1
answered on 09 Apr 2012, 12:10 PM
Thank you for the explanation. The solution worked, I ended up tracking the mouse with "MouseEnter" and "MouseLeave", and in "PreviewEndEdit" I set "e.Handled" to true if the mouse was over the control.
Tags
Diagram
Asked by
James
Top achievements
Rank 1
Answers by
Alex Fidanov
Telerik team
James
Top achievements
Rank 1
Share this question
or