This is a migrated thread and some comments may be shown as answers.

HTML Rendering control

17 Answers 183 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
sachin
Top achievements
Rank 1
sachin asked on 04 Dec 2008, 02:04 PM
Hi

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

Sort by
0
Valeri Hristov
Telerik team
answered on 08 Dec 2008, 08:05 AM
Hello sachin,

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.
0
Anita
Top achievements
Rank 1
answered on 18 Mar 2009, 05:16 PM
What is the counterpart or equivalent of HTMlPlaceholder in ASP .net rad controls? Is there one?
0
Valentin.Stoychev
Telerik team
answered on 19 Mar 2009, 10:48 AM
Hello Anita,

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.
0
Anita
Top achievements
Rank 1
answered on 19 Mar 2009, 01:37 PM
ummm...ok.
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.
0
Tihomir Petkov
Telerik team
answered on 19 Mar 2009, 04:13 PM
Hello Anita,

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.
0
Anita
Top achievements
Rank 1
answered on 19 Mar 2009, 04:21 PM
So does tha mean, that once that propery is set, user can copy paste html in the radeditor for asp.net and view without html tags in view mode? (not programmatically) I have not used this editor much.
IF so, that is exactly I will be looking for for radeditor in Silverlight. I am currently evaluating CTP version.

Thanks!
0
Valentin.Stoychev
Telerik team
answered on 19 Mar 2009, 05:17 PM
Hello Anita,

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.
0
Anita
Top achievements
Rank 1
answered on 19 Mar 2009, 05:56 PM
sure...what our users want to do is paste "<b>Anita</b>" in the eidtor and the plaxeholder sould return it bold.
I tried it with radeditor for SL  and the placeholder just displayed the string "<b>Anita</b>".
0
Valentin.Stoychev
Telerik team
answered on 20 Mar 2009, 07:51 AM
Hello Anita,

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.
0
Anita
Top achievements
Rank 1
answered on 20 Mar 2009, 09:10 AM

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).

 

0
Valentin.Stoychev
Telerik team
answered on 20 Mar 2009, 10:13 AM
Hi Anita,

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.
0
Anita
Top achievements
Rank 1
answered on 20 Mar 2009, 11:06 AM
Alright! Thanks!

We will look forward to it.
0
rhodmie sagum
Top achievements
Rank 1
answered on 03 Mar 2010, 09:08 AM
Hi,

Can you guys please list which controls of the RadEditor | HTMLEditor contain HTML tags which is not supported in Silverlight? Are these controls can be disable?

We'd like to implement a way so that controls that produces unsupported tags in Silverlight is disabled in RadEditor, is this possible?

Thanks,
0
Valentin.Stoychev
Telerik team
answered on 04 Mar 2010, 07:00 AM
Hello rhodmie sagum,

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.
0
rhodmie sagum
Top achievements
Rank 1
answered on 04 Mar 2010, 08:02 AM
hi,

Sorry for the confusion, what I mean is the MS HTML Textblock

Thanks


0
Valentin.Stoychev
Telerik team
answered on 05 Mar 2010, 09:21 AM
Hello rhodmie sagum,

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.
0
rhodmie sagum
Top achievements
Rank 1
answered on 05 Mar 2010, 10:36 AM
Hi,

Thanks, that actually how our application does. Only, we save into database the html tags produced by RadEditor as string, which the MS HTML Textblock control calls via db queries.

Anyway, we are now working on a validation to trap the said scenario based on the list provided by MS.

Thank you very much
Tags
General Discussions
Asked by
sachin
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Anita
Top achievements
Rank 1
Valentin.Stoychev
Telerik team
Tihomir Petkov
Telerik team
rhodmie sagum
Top achievements
Rank 1
Share this question
or