3 Answers, 1 is accepted
0
Hello Ishara,
Thank you for writing.
When RadPropertyGrid is not in read-only mode users can edit the content of the selected item. There are a number of built-in editors which are used for editing different data types. These editors can be customized or can be replaced by custom editors. Here you can find an article explaining how to create custom editor: http://www.telerik.com/help/winforms/propertygrid-editors-using-custom-editor.html.
Attached you can find a sample demo application where the standard text box editors are replaced with RichTextBox editors. Note that RadRichTextBoxElement does not have 'Text' property since it supports different formats for importing and exporting documents. In the attached demo I use TxtFormatProvider, which is used for importing/exporting of plain text document. If you want to use another format, you can read this documentation article and use the desired format: http://www.telerik.com/help/winforms/richtextbox-faq.html
Here you can read about the specific events exposed by the RadRichTextBox control: http://www.telerik.com/help/winforms/richtextbox-events.html
I hope this helps. Should you have any other questions, do not hesitate to contact us.
Regards,
Plamen
the Telerik team
Thank you for writing.
When RadPropertyGrid is not in read-only mode users can edit the content of the selected item. There are a number of built-in editors which are used for editing different data types. These editors can be customized or can be replaced by custom editors. Here you can find an article explaining how to create custom editor: http://www.telerik.com/help/winforms/propertygrid-editors-using-custom-editor.html.
Attached you can find a sample demo application where the standard text box editors are replaced with RichTextBox editors. Note that RadRichTextBoxElement does not have 'Text' property since it supports different formats for importing and exporting documents. In the attached demo I use TxtFormatProvider, which is used for importing/exporting of plain text document. If you want to use another format, you can read this documentation article and use the desired format: http://www.telerik.com/help/winforms/richtextbox-faq.html
Here you can read about the specific events exposed by the RadRichTextBox control: http://www.telerik.com/help/winforms/richtextbox-events.html
I hope this helps. Should you have any other questions, do not hesitate to contact us.
Regards,
Plamen
the Telerik team
0
ishara
Top achievements
Rank 1
answered on 08 Dec 2012, 12:46 PM
Hi Plamen,
Thanks for your reply and example..i managed to add a richtextbox to the propertygrid. but when i quit the editor it change the colors to black again..only while editor active it shows the colors.. is it by design or can we have colors after editing as well?
Thank,
Ishara
0
Hi ishara,
Thank you for writing.
In the attached demo below I used TxtFormatProvider, which is used for importing/exporting of plain text document. This provider removes all text formatting. In your case you could use HtmlFormatProvider to import/export HTML documents and this will allow you to make changes:
In addition, you could take a look at our documentation article about Import/Export Settings: http://www.telerik.com/help/winforms/richtextbox-features-import-export-import-export-settings.html.
I hope this helps. Let me know if you have further enqueries.
All the best,
Plamen
the Telerik team
Thank you for writing.
In the attached demo below I used TxtFormatProvider, which is used for importing/exporting of plain text document. This provider removes all text formatting. In your case you could use HtmlFormatProvider to import/export HTML documents and this will allow you to make changes:
using Telerik.WinControls.RichTextBox.FileFormats.Html;
public
override
object
Value
{
get
{
HtmlFormatProvider provider =
new
HtmlFormatProvider();
return
provider.Export(
this
.Editor.Document);
}
set
{
string
text = Convert.ToString(value);
if
(text !=
this
.Value)
{
HtmlFormatProvider provider =
new
HtmlFormatProvider();
this
.Editor.Document = provider.Import(Encoding.Default.GetBytes(text));
}
}
}
In addition, you could take a look at our documentation article about Import/Export Settings: http://www.telerik.com/help/winforms/richtextbox-features-import-export-import-export-settings.html.
I hope this helps. Let me know if you have further enqueries.
All the best,
Plamen
the Telerik team