Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
145
UltraControlContainerEditor does not work with RichtTextBox as RenderControl
posted

Hello,

I'm using UltraControlContainerEditor with to RichTextBoxes (one as EditControl, one as RenderControl).

Using the RichTextBox as RenderControl doesn't work, it only displays the borders. After looking at the sources i think the problem is that DrawToBitmap does not work for RichTextBoxes.

Another thing is that the ControlContainerEditor expects for the EditControl an event with the Name propertyname + "Changed". That is also not suitable for an RTF-Edit using the Rtf-Property. There is no RtfChanged-Event only a TextChanged-Event. My workaround is a new control derived from RichTextBox which exposes the TextChanged-Event also as RtfChanged-Event.

Is there a workaround for the first issue regarding the RenderControl?

 

kind regards

Oliver

 

Parents
No Data
Reply
  • 69832
    Suggested Answer
    Offline posted

    Ironically there is a C# WinGrid sample, 'RichTextEditor', which demonstrates how to turn a RichTextEditor into an embeddable editor that can be hosted in a grid cell. The degree of difficulty in implementing a custom embeddable editor, such as that which is demonstrated by that sample, was one of the reasons we decided to add the UltraControlContainerEditor.

    One of the limitations of the UltraControlContainerEditor is that it works best with controls that follow the .NET model for rendering itself, and the RichTextBox is one of the worst offenders in that regard, being in actuality a very old control for which MS created a .NET wrapper.

    I don't think there is a realistic workaround for the issue you describe here, although the RichTextEditor sample does demonstrate how to render the rich text using the windows messages supported by that control.

Children
No Data