public override bool EndEdit()
        {
            RichTextEditorElement element        = this.EditorElement as RichTextEditorElement;
            RadRichTextEditor     richTextEditor = element.HostedControl as RadRichTextEditor;

            richTextEditor.Document.DocumentContentChanged -= this.OnDocumentContentChanged;

            return(base.EndEdit());
        }
        public override void BeginEdit()
        {
            base.BeginEdit();

            RichTextEditorElement element        = this.EditorElement as RichTextEditorElement;
            RadRichTextEditor     richTextEditor = element.HostedControl as RadRichTextEditor;

            richTextEditor.Document.DocumentContentChanged += this.OnDocumentContentChanged;
        }
Exemple #3
0
 private void RadGridView1_CurrentCellChanged(object sender, CurrentCellChangedEventArgs e)
 {
     if (e.NewCell != null && e.NewCell.ColumnInfo is GridViewRichTextColumn)
     {
         RichTextEditorCellElement cellElement = this.radGridView1.TableElement.GetCellElement(e.NewCell.RowInfo,
                                                                                               e.NewCell.ColumnInfo) as RichTextEditorCellElement;
         if (cellElement != null)
         {
             RichTextEditorElement element = (RichTextEditorElement)((RichTextEditor)cellElement.Editor).EditorElement;
             RadRichTextEditor     textBox = (RadRichTextEditor)element.HostedControl;
             this.richTextEditorRibbonBar1.AssociatedRichTextEditor = textBox;
             Console.WriteLine(textBox.GetHashCode());
         }
     }
 }
        protected override void SetContentCore(object value)
        {
            try
            {
                this.editor.Value = Convert.ToString(value);

                if (this.Value != null && this.Value != DBNull.Value && this.Value.ToString() != "")
                {
                    RichTextEditorElement element  = (RichTextEditorElement)this.editor.EditorElement;
                    RadRichTextEditor     textBox  = (RadRichTextEditor)element.HostedControl;
                    HtmlFormatProvider    provider = new HtmlFormatProvider();

                    RadDocument document = provider.Import(this.Value.ToString());
                    textBox.Document    = document;
                    document.LayoutMode = DocumentLayoutMode.Flow;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(null, ex.ToString(), "EXCEPTION", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }