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

RadRichTextBox html lost (dl, dt and dd tags)

1 Answer 68 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Dzmitry
Top achievements
Rank 1
Dzmitry asked on 18 Apr 2014, 02:21 PM
Hi Everyone

I'm using the RadRichTextBox for displaying email messages. And now I have an issue with it - if message contains html with dl, dt and dd tags - all data between these tags is lost.
Here is the example of XAML:
01.<Grid x:Name="LayoutRoot" Background="White">
02.        <Grid.RowDefinitions>
03.            <RowDefinition Height="Auto"></RowDefinition>
04.            <RowDefinition Height="*"></RowDefinition>
05.        </Grid.RowDefinitions>
06.        <Grid.ColumnDefinitions>
07.            <ColumnDefinition></ColumnDefinition>
08.            <ColumnDefinition></ColumnDefinition>
09.        </Grid.ColumnDefinitions>
10.        <Button Grid.Row="0" Grid.Column="0" Click="SetValidData">Set Valid Html Data</Button>
11.        <Button Grid.Row="0" Grid.Column="1" Click="SetBrokenData">Set Broken Html Data</Button>
12.        <telerik:RadRichTextBox x:Name="emailContentTextBox" Grid.Row="1" Grid.ColumnSpan="2" AcceptsTab="True">
13.        </telerik:RadRichTextBox>
14.    </Grid>

And here is the C#:
01.public partial class MainPage
02.{
03.    public MainPage()
04.    {
05.        InitializeComponent();
06.    }
07. 
08.    public string HtmlDataBroken
09.    {
10.        get
11.        {
12.            return "<!DOCTYPE html><html><body><ul><li>One</li><li>Two</li></ul><dl><dt>Coffee</dt><dd>Black hot drink</dd><dt>Milk</dt><dd>White cold drink</dd></dl><ul><li>Three</li><li>Four</li></ul></body></html>";
13.        }
14.    }
15.     
16.    public string HtmlDataValid
17.    {
18.        get
19.        {
20.            return "<!DOCTYPE html><html><body><ul><li>One</li><li>Two</li></ul><table><tr>Coffee</tr><tr>Black hot drink</tr><tr>Milk</tr><tr>White cold drink</tr></table><ul><li>Three</li><li>Four</li></ul></body></html>";
21.        }
22.    }
23. 
24.    private void SetBrokenData(object sender, System.Windows.RoutedEventArgs e)
25.    {
26.        emailContentTextBox.Document = new HtmlFormatProvider().Import(this.HtmlDataBroken);
27.    }
28. 
29.    private void SetValidData(object sender, System.Windows.RoutedEventArgs e)
30.    {
31.        emailContentTextBox.Document = new HtmlFormatProvider().Import(this.HtmlDataValid);
32.    }
33.}

So, maybe you can suggest the solution of this issue or another control for my needs?

Best regards,
Dzmitry

1 Answer, 1 is accepted

Sort by
0
Mihail
Telerik team
answered on 22 Apr 2014, 11:15 AM
Hello Dzmitry,
 
 Thank you for contacting us.

Our RadRichTextBox do not support description lists at this stage. I will add this as feature request to out to do list. It will be with low priority as it is feature of the html format and our RadRichTextBox is closer to word processor rather than html editor.

As workaround I can suggest you to preprocess the document and change the dl, dt and dd tags to paragraphs with left margin in order to position the text correctly.

I hope this information is helpful for you.

Regards,
Mihail
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
RichTextBox
Asked by
Dzmitry
Top achievements
Rank 1
Answers by
Mihail
Telerik team
Share this question
or