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

RichTextEditor HTML import Issue for Winforms

9 Answers 115 Views
RichTextEditor
This is a migrated thread and some comments may be shown as answers.
kranthi
Top achievements
Rank 1
kranthi asked on 08 Oct 2017, 09:52 PM

HI,

 

I have problem with RichTextEditor when importing a html string using HTMLFormatProvider.

After the import RichTexteditor still showing the HTML instead of showing the actual content from the HTML (like browser displayed format).

Please suggest some solution for this issue.

 

Thanks

 

9 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 09 Oct 2017, 09:13 AM
Hi,

Can you send us the entire code that you're using to import an show the document?

I am looking forward to your reply.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
kranthi
Top achievements
Rank 1
answered on 09 Oct 2017, 05:52 PM

Hi Dimitar,

Thanks for your response, The issue was with the spaces introduced in html when I manually copied the html string to visualstudio .cs file.

When I corrected the spaces the content was being displayed in RichTextEditor.

But I am still facing alignment issues as the imported html alignment in RichTexteditor is different from that of the original html.

I am experimenting this on StructuredContent Example provided which includes Recipe/Html/Preview tabs (satisfying our requirement).

Please find below the sample html I am using and  suggest some solution for this.

 

<html>
<head>
</head>
<body>
    <table align="center" style="width:728px; height:26px;">
        <tbody>
            <tr>
                <td colspan="2">
                    <p style="text-align:center;">SAMPLE HTML WITH TABLE</p>
                </td>
            </tr>
            <tr>
                <td colspan="2"><img alt="##NAME##" src="##IMGSRC##" /></td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
                <td colspan="2"><span style="font-family: Tahoma; font-size:13px;">Text1#</span></td>
            </tr>
            <tr>
                <td colspan="2"><span style="font-family:Tahoma; font-size:13px;">Text2 </span></td>
            </tr>
            <tr>
                <td colspan="2"><span style="font-family:Tahoma; font-size:13px;">Text3</span></td>
            </tr>
            <tr>
                <td colspan="2"><span style="font-family:Tahoma; font-size:13px;">Text4</span></td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
                <td colspan="2"><span style="font-family: Tahoma;"><span style="font-size: 13px;"><strong>##NAME##</strong> Some TExt hfjkhsdfkjsdhfjksdlfsdlkfjsdlkfjdskfhdsfjkhfkjhdfkdjhnf jdfhkdjfhdkjfhkdjfhkdjfhkdj <span style="text-decoration: underline;">xxxxxxxxxxxxxxx</span> aaaaaaaaaaaaaaaaaaaa </span><strong><span style="font-size: 12px;">##NAME##</span></strong><span style="font-size: 13px;">'<strong>s</strong> Any help really appreciated</span></span></td>
            </tr>
            <tr>
                <td colspan="2"></td>
            </tr>
            <tr>
                <td colspan="2">
                    <span style="font-family: Tahoma; font-size: 13px;">dsfdhkfjhdsfkjhdskfjhsdfjkh jghsdghsdghsdghsdghsdfsjk</span>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <span style="font-family: Tahoma; font-size: 10px;"></span>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <span style="font-family: Tahoma; font-size: 13px;">
                        <ul>
                            <li>gdkjshdlkkdpowuiejhfkjdj;lsk jkfhsdkjfhskljfslfsdlkfj</li>
                        </ul>
                    </span>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <span style="font-family: Tahoma; font-size: 13px;">
                        <ul>
                            <li>Date ___/___/_____</li>
                        </ul>
                    </span>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <span style="font-family: Tahoma; font-size: 10px;"></span>
                </td>
            </tr>
        </tbody>
    </table>
</body>
</html>

Thanks

 

0
kranthi
Top achievements
Rank 1
answered on 09 Oct 2017, 06:08 PM

Addition to Above:

I am using below code to Import the above mentioned html string:

HtmlFormatProvider htmlFormatProvider = new HtmlFormatProvider();         
 this.radRichTextEditor1.Document = htmlFormatProvider.Import(inputHtmlStr);

 

Thanks,

Kranthi

 

0
kranthi
Top achievements
Rank 1
answered on 09 Oct 2017, 06:09 PM

Addition to above:

I am using below code to import the above mentioned html string:

 HtmlFormatProvider htmlFormatProvider = new HtmlFormatProvider();

  this.radRichTextEditor1.Document = htmlFormatProvider.Import(inputHtmlStr);

 

Thanks

0
Dimitar
Telerik team
answered on 10 Oct 2017, 02:21 PM
Hello Kranthi,

Using the code and the HTML I have created a project and it seems to work ok on my side. Could you please check it and let me know how it differs from your setup?

I am looking forward to your reply.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
kranthi
Top achievements
Rank 1
answered on 10 Oct 2017, 04:56 PM

Hi Dimitar,

Thanks for looking into this.

The alignment is still different when we open the Test.html file in web browser(Ex:Internet Explorer) and when opened in RichTextEditor.

Please let me know if you need any additional information.

Thanks

 

0
Dimitar
Telerik team
answered on 12 Oct 2017, 12:25 PM
Hello Kranthi,

This appears to be a known issue with the "align" attribute. It is already logged in our Feedback Portal. You can track its progress, subscribe for status changes and add your comment to it here

The alignment will be ok if you remove the align tag attribute. Please note that this tag is deprecated and is not supported in HTML 5: HTML table align Attribute.

Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
kranthi
Top achievements
Rank 1
answered on 20 Oct 2017, 03:25 PM

Hi Dimitar,

Thanks for your Response, I have subscribed for the mentioned post.

I am trying to find a workaround for this issue so want to use webbrowser control instead of RichTextEditor.

But I am not sure how to associate webbrowser control to RadRibbonbar.

Can you please suggest.

Thanks,

Kranthi

 

 

 

 

 

 

 

0
Dimitar
Telerik team
answered on 23 Oct 2017, 06:35 AM
Hello Kranthi,

You cannot associate the RichTextEditorRibbonBar with a web browser control. We do not have a control that can be associated with a web browser control. In this case, you will need to manually add buttons to a blank ribbon bar and implement the desired functionality. 

Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
RichTextEditor
Asked by
kranthi
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
kranthi
Top achievements
Rank 1
Share this question
or