RichTextEditor HTML import Issue for Winforms

10 posts, 0 answers
  1. kranthi
    kranthi avatar
    6 posts
    Member since:
    Oct 2017

    Posted 08 Oct 2017 Link to this post

    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

     

  2. Dimitar
    Admin
    Dimitar avatar
    2019 posts

    Posted 09 Oct 2017 Link to this post

    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.
  3. kranthi
    kranthi avatar
    6 posts
    Member since:
    Oct 2017

    Posted 09 Oct 2017 in reply to Dimitar Link to this post

    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

     

  4. kranthi
    kranthi avatar
    6 posts
    Member since:
    Oct 2017

    Posted 09 Oct 2017 in reply to kranthi Link to this post

    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

     

  5. kranthi
    kranthi avatar
    6 posts
    Member since:
    Oct 2017

    Posted 09 Oct 2017 in reply to kranthi Link to this post

    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

  6. Dimitar
    Admin
    Dimitar avatar
    2019 posts

    Posted 10 Oct 2017 Link to this post

    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.
  7. kranthi
    kranthi avatar
    6 posts
    Member since:
    Oct 2017

    Posted 10 Oct 2017 in reply to Dimitar Link to this post

    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

     

  8. Dimitar
    Admin
    Dimitar avatar
    2019 posts

    Posted 12 Oct 2017 Link to this post

    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.
  9. kranthi
    kranthi avatar
    6 posts
    Member since:
    Oct 2017

    Posted 20 Oct 2017 in reply to Dimitar Link to this post

    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

     

     

     

     

     

     

     

  10. Dimitar
    Admin
    Dimitar avatar
    2019 posts

    Posted 23 Oct 2017 Link to this post

    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.
Back to Top