I am working in a scenario where i want to convert HTML to Rich formatted text like in Resume or CV
I am getting HTML from DB and storing it into a div tag
var t = dgBottomGrid.SelectedItem.GetType();
var s = (string)t.GetProperty("Body").GetValue(this.dgBottomGrid.SelectedItem, null);
HtmlDocument doc = HtmlPage.Document;
HtmlElement div = doc.GetElementById("htmlSample");
div.SetAttribute("innerHTML", s);
My div tag converts this to Rich Formatted Text
But when i m going to put it into a plain textbox, then it is not displaying propery.
Is there any idea how can i do this ?
Is there any control by Telerik to Show Rich Formatted Text ?
Regards,
Sachin
17 Answers, 1 is accepted
Unfortunately, your requirement is currently impossible with the tools that Silverlight 2 provides. The TextBox control can display only plain text. The TextBlock control, however, can display formatted text, but is not editable and you cannot directly put HTML inside.
We have plans to create a HtmlPlaceholder control in Q1 2009 which is scheduled for the end of February. It will be able to get and display any HTML. As for the editability, in Q1 we will be also releasing a CTP of RadEditor for Silverlight.
Regards,
Valeri Hristov
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
ASP.NET controls are rendering html by default - they do not need such a control. Do you have any suggestion?
Greetings,
Valentin.Stoychev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Another request was our users want to copy paste html in radeditor for both asp.net and silverlight and want them to render as html in view mode? Is it possible? I tried copy pasting html and it showed html tags.
The CTP version of RadEditor for Silverlight does not support the scenario in which users paste HTML content in the editor and then that content is automatically rendered. However, RadEditor has a Html property which you can set with your own content, as well as a PasteHtml() method which pastes HTML content in the current place of the cursor. If there is popular demand for the scenario you describe we will certainly consider implementing it.
Best wishes,
Tihomir Petkov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
IF so, that is exactly I will be looking for for radeditor in Silverlight. I am currently evaluating CTP version.
Thanks!
I'm not sure I fully understand your request. Can you help me by clarifying it please?
I can say that both ASP.NET and Silverglight versions of the RadEditor support copy/paste of html/text/image content. You can copy content from anywhere (web site, another text editor, etc) and to paste it inside our Silverlight editor. Then you can get the whole content of the editor and to display (view) that content by using the RadHtmlPlaceholder control - just like our demo is created here:
http://demos.telerik.com/silverlight/#Editor/FirstLook
Looking forward for your reply!
All the best,
Valentin.Stoychev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
I tried it with radeditor for SL and the placeholder just displayed the string "<b>Anita</b>".
I see now. The problem is that the text you are copiying is getting into the clipboard as text and then is pasted as text into the editor. If you copy the text as html and it is stored into the clipboard as html it will behave in editor and in html placeholder correclty.
If you open the demos application and copy the text below:
" DEMO TEXT - COPY and PASTE INTO THE DEMOS APPLICATION"
you will see that the formatting is kept.
If your requirement is to paste text that contains HTML tags and then display it correctly as HTML you should use a simple textbox and then to give the content of the textbox to be rendered with the HtmlPlaceholder.
Hope this helps!
Best wishes,
Valentin.Stoychev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Thanks for you help in understanding!
I believe and correct if I am wrong, but ASP .net radeditor allows you to to write html in html mode and can render it correctly.
SL editor misses that. When can we expect SL editor to work the same wasy as ASP .net one. It is highly needed as then we can provide users the same experience when switching between the two applications (.net and SL).
Yes - the asp.net editor has one more view - HTMLView which we still have not in our Silverlight editor. It is in our plans, but I can not stick with a specific date.
Best wishes,
Valentin.Stoychev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
We will look forward to it.
Can you clarify what do you mean? Basically none of the Html tags are supported in Silverlight, because SL is not using Html to render the content.
Sincerely yours,
Valentin.Stoychev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Here how all is working:
- you input Html with the RadEditor - you can use any tools
- the produced html is then displayed with the html placeholder, which uses the web browser to render the produced content.
So in this case - there is not interaction with SL at all. Everything is handled from the browser html rendering engine.
Greetings,
Valentin.Stoychev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.