Hello! I try to add text to RadRichTextBox but anything it is impossible!
On standard richtextbox everything is good. How here to make analog of code for RadRichTextBox? Thanks!
On standard richtextbox everything is good. How here to make analog of code for RadRichTextBox? Thanks!
using
(SqlDataReader dr = cmd.ExecuteReader())
{
while
(dr.Read())
richTextBox1.AppendText(
"\n"
+ dr[
"data"
] +
": "
+ dr[
"UserName"
] +
": "
+ dr[
"message"
].ToString());
}
11 Answers, 1 is accepted
0
Hello Stas,
Thank you for writing.
Please refer to the following article which explains how you can import data in RadRichTextEditor: Import/Export | UI for WinForms Documentation.
I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.
Regards,
Stefan
Telerik
Thank you for writing.
Please refer to the following article which explains how you can import data in RadRichTextEditor: Import/Export | UI for WinForms Documentation.
I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.
Regards,
Stefan
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
Stas
Top achievements
Rank 1
answered on 23 Feb 2015, 09:36 AM
No, I don't want import or export. I want to learn as to add the text in RadRichTextBox? How to add the text as on a screenshot in the attachment?
I already tried, it is impossible to me... In standard RichTextBox everything ok
I already tried, it is impossible to me... In standard RichTextBox everything ok
0
Stas
Top achievements
Rank 1
answered on 23 Feb 2015, 12:45 PM
Forgive, my question about RadRichTextBox but not radRichTextEditor.
Please, give a code sample on my question
Please, give a code sample on my question
0
Hi,
Adding text in RadRichTextBox and RadRichTextEditor is done via importing, not with the Text property. Here is how your code will look like:
Still, we do have a feature request for adding plain text or html text with the Text property. You can track its status and add your vote (like) for it here: http://feedback.telerik.com/Project/154/Feedback/Details/111956-add-radrichtextbox-init-the-content-using-text-property-with-support-of-html-f.
As to using RadRichTextBox instead of RadRichTextEditor, I would strongly recommend using the latter, as it it a much better version of the editor control.
I hope that you find this information useful.
Regards,
Stefan
Telerik
Adding text in RadRichTextBox and RadRichTextEditor is done via importing, not with the Text property. Here is how your code will look like:
protected
override
void
OnLoad(EventArgs e)
{
base
.OnLoad(e);
string
text =
""
;
using
(SqlDataReader dr = cmd.ExecuteReader())
{
while
(dr.Read())
text +=
"\n"
+ dr[
"data"
] +
": "
+ dr[
"UserName"
] +
": "
+ dr[
"message"
].ToString();
}
radRichTextEditor1.Document = ImportString(text);
}
public
RadDocument ImportXaml(
string
content)
{
TxtFormatProvider provider =
new
TxtFormatProvider();
return
provider.Import(content);
}
Still, we do have a feature request for adding plain text or html text with the Text property. You can track its status and add your vote (like) for it here: http://feedback.telerik.com/Project/154/Feedback/Details/111956-add-radrichtextbox-init-the-content-using-text-property-with-support-of-html-f.
As to using RadRichTextBox instead of RadRichTextEditor, I would strongly recommend using the latter, as it it a much better version of the editor control.
I hope that you find this information useful.
Regards,
Stefan
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
Stas
Top achievements
Rank 1
answered on 05 Mar 2015, 07:32 PM
Thanks Bro! I love you!
0
Stas
Top achievements
Rank 1
answered on 05 Mar 2015, 07:53 PM
How to add text to an already existing? Analogue of appendtext? That would not load constantly new document...
0
Stas
Top achievements
Rank 1
answered on 05 Mar 2015, 08:39 PM
I'm sorry, did using .insert! Thanks!
0
0
Hello Stas,
Here you are:
I hope this helps.
Regards,
Stefan
Telerik
Here you are:
this
.radRichTextEditor1.Document.CaretPosition.MoveToLastPositionInDocument();
this
.radRichTextEditor1.Insert(
"alabala"
);
I hope this helps.
Regards,
Stefan
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
Stas
Top achievements
Rank 1
answered on 06 Mar 2015, 09:00 PM
Thanks bro, but you code inserts text without ntml, see screenshot
0
Hello Stas,
I am working with the latest version of RadRichTextEditor and the behavior is not as you described on my end.
Importing file:
results in:
Attached you can find the sample I am testing with. Can you please have a look at it and let me know how it differs from your setup?
I am looking forward to your reply.
Regards,
Stefan
Telerik
I am working with the latest version of RadRichTextEditor and the behavior is not as you described on my end.
Importing file:
<!DOCTYPE html>
<
html
>
<
body
>
<
span
style
=
"color:red"
><
strong
>Здравствуйте!</
strong
></
span
>
</
body
>
</
html
>
results in:
…......
<
body
><
p
class
=
"NormalWeb "
><
span
class
=
"s_A9BC7DFB"
>Здравствуйте!TEST</
span
></
p
></
body
></
html
>
Attached you can find the sample I am testing with. Can you please have a look at it and let me know how it differs from your setup?
I am looking forward to your reply.
Regards,
Stefan
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.