BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
Hi Carlos,
Thank you for interest in Syncfusion products.
Currently our RichTextBoxAdv control supports internal CSS declaration
specified by “.class” selectors only while loading Html. The only way to apply
CSS to the document is concatenating CSS string to Html text. Our RichTextBoxAdv
control does not have support for other internal CSS declarations or external
CSS. We have already logged this requirement as
feature request. We will implement this feature in any of our upcoming
releases. We usually have an interval of at least three months between
releases. The feature implementation would also greatly depend on the factors
such as product design, code compatibility and complexity. We will update you
when this feature has been implemented. This feature can be tracked through our
Features Management System:
Feature Links:
http://www.syncfusion.com/support/directtrac/features/SL-3011.
Please let us know if you have any other questions.
Regards,
Arumuga Perumal S.
Hi Carlos,
Thank you for your update.
Regarding “CSS not being applied correctly”:
As mentioned in our previous update, currently our RichTextBoxAdv control
supports internal CSS declarations specified by “.class” selectors only while loading Html. We have mentioned the
sample Html with CSS specified by “.class” selectors below. Below highlighted
text specifies the class id that
defines styles for Html elements declared with it.
Sample Html:
<html> <head> <style
type="text/css"> .style2057599524 {
font-style: Normal;
background-color: #ffffff;
color: #C3D69B;
font-size: 12pt;
font-family: Times New Roman; }
.style1080765180 {
font-style: Normal;
background-color: #ffffff;
color: #C3D69B;
font-size: 12pt;
font-family: Times New Roman; }
.style944000491 {
text-align: Left;
margin: 0px 0px 0px 0px; }
.style636870544 {
text-align: Center;
margin: 0px 0px 0px 0px; }
.style1416807578 {
text-align: Center;
margin: 0px 0px 0px 0px; }
</style> </head> <body> <table
class="style944000491" border="1">
<tr>
<td>
<p class="style636870544">
<span class="style2057599524">Directions to location</span>
</p>
</td>
<td>
<p class="style1416807578">
<span class="style1080765180">Cell</span>
</p>
</td>
</tr>
</table> </body> </html> |
We have modified your sample to demonstrate the same and
mentioned the sample code snippet below.
Sample C# code:
string bodyStartTag = "<body
class=\"style1\">"; string bodyEndTag = "<br><table
class=\"style1\">
<tr><td>Data1</td><td>Data2</td></tr><tr><td>Data3</td><td>Data4</td></tr></table></body>"; string cssExample = "<head><style> .style1 { margin: 0; padding: 0; background:
red; } </style></head>"; |
Regarding “styles for body not being applied”:
We are able to reproduce the mentioned issue with styles for <body>
elements not preserved while loading Html into RichTextBoxAdv control.
Currently we are investigating on this. We will update you with more details on
January 19 2015.
Regaring “partial Html import”:
Currently our RichTextBoxAdv supports importing well formatted Html only and
does not have support for importing partial Html.
Please let us know if you have any other questions.
Regards,
Arumuga Perumal S.