RadRichTextbox in RadDiagramShape

3 posts, 1 answers
  1. James
    James avatar
    3 posts
    Member since:
    Apr 2012

    Posted 07 Apr 2012 Link to this post

    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. Answer
    Alex Fidanov
    Admin
    Alex Fidanov avatar
    636 posts

    Posted 09 Apr 2012 Link to this post

    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 >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. James
    James avatar
    3 posts
    Member since:
    Apr 2012

    Posted 09 Apr 2012 Link to this post

    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.
Back to Top