Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

OBSOLETE - How to create a PropertyEditor based on the XtraRichEdit control

$
0
0

UPDATE: Use the Office Module to integrate DevExpress WinForms Rich Text Editor in all new XAF WinForms applications. The current example is obsolete.


Take special note that this editor is intended to be used for a simple and most common scenario when only one text property in a Detail View is edited with the help of the XtraRichEdit control (RichEditControl). Other scenarios are not supported in this example and are required to be implemented manually. For example, if there are more than one property, edited with this editor in a Detail View, then there may be problems with merging in ribbons. See the B142856 issue for more detailed information.

Important Notes
1.
 Please take special note that this example is not a complete solution and is supposed to be further tested and modified by you according to your business requirements.

2. The standard XAF Save Action may be activated on the first load in this example, because the MS Word and XtraRichEdit RTF formats are different and thus the object receives a different value on the first value post. Once you save the value in the control's format, it will work as expected. See also the Problem with setting the RtfText in XtraRichEdit and ImmediatePostData with XtraRichEdit tickets for the details on how to improve tracking of changed values in the RichEditControl component.

 

See Also:
Implement Custom Property Editors
How to: Implement a Property Editor for Windows Forms Applications
XtraRichEdit Home
PropertyEditors - Support the XtraRichEdit control.

Question Comments

Added By: Willem de Vries at: 10/24/2012 7:25:46 AM    

After copying the necessary files to my project, i ran into an error in MergeRibbonDetailViewController. I changed the code slightly (in the test):

        private void Frame_TemplateChanged(object sender, EventArgs e) {
            UnMergeRibbon();
            mainRibbonControl = null;
            IClassicToRibbonTransformerHolder form = Frame.Template as IClassicToRibbonTransformerHolder;
            if (form != null && form.RibbonTransformer != null) {
                form.RibbonTransformer.Transformed += RibbonTransformer_Transformed;
            }
        }

Added By: Jerome Pech at: 5/16/2016 12:15:32 PM    Merging the Ribbon does not work if UseOldTemplated = false; is set. 
[C#]
return((XtraFormTemplateBase)(Application.MainWindow.Template)).Ribbon;
causes an error, that DetailFormRibbonV2 can not be converted to XtraFormTemplateBase.

Can you please provide an example how to merge ribbons with the new Ribbon V2 (using 15.2)?











Added By: Dennis (DevExpress Support) at: 5/17/2016 2:49:05 AM    

@Jerome: Thanks for your input. Our team will take it into account. Even though we do not currently have free resources to provide a different example, you can refer to the eXpressApp Framework > Task-Based Help > How to: Access the Ribbon Control article to learn more on how to access the ribbon component and implement this merging yourself (by analogy with what was shown in the original example). Should you experience any difficulties, do not hesitate to submit a separate ticket to discuss your implementation (https://www.devexpress.com/Support/Center/Question/Create).

Added By: Jerome Pech at: 5/17/2016 3:43:53 AM    @Dennis

The link "How to: Access the Ribbon Control" helped me to accomplish my task!

Tanks a lot!

Kind regards Added By: Dennis (DevExpress Support) at: 5/17/2016 4:11:12 AM    @Jerome: Anytime! Feel free to share your Controller here for other XAF users.Added By: Jerome Pech at: 5/17/2016 4:33:04 AM    Sure!

Simply replace
[C#]
if(Application.MainWindow!=null&&Application.MainWindow.Template!=null){return((XtraFormTemplateBase)(Application.MainWindow.Template)).Ribbon;}

with
[C#]
if(Application.MainWindow!=null&&Application.MainWindow.Template!=null&&Frame.TemplateisDetailRibbonFormV2){return((DetailRibbonFormV2)(Frame.Template)).Ribbon;}

Added By: Andrey K (DevExpress Support) at: 3/27/2018 1:40:57 PM    

Hello,

We are going to provide Rich Text Editor integration in an upcoming release, so this example will be obsoleted. Please refer to the T608185: WinForms Rich Text Editor Module - v18.1 Preview article to see implementation details and provide us with your opinion regarding it.
If you have already seen this article, please refer to it again and answer our Q6 question (we added it recently). 

Thanks,
Andrey


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>