Telerik Forums
UI for WPF Forum
0 answers
9 views

I have an ImageInline in xaml file. And loading this image file is relatively slow. So I think it is the main reason throw that exception. Has anyone had this problem? Please help me answer this question.
Many thanks.

Telerik.Windows.Documents (Version: 2021.1.223.45) 

Telerik.Windows.Documents.FormatProviders.Xaml (Version: 2021.1.223.45)

Telerik.Windows.Documents.FormatProviders.Html(Version: 2021.1.223.45)

Tran
Top achievements
Rank 1
 asked on 10 Apr 2024
0 answers
9 views

I'am using Telerik RichTextBox (trial) control in my WPF desktop application. When running the app, the control(WordControl) showing as transparent. Suppose the background image (laptop) should not be seen.


**WordControl.xaml**

```
<UserControl x:Class="MyApp.WordControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
            xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
            xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"

             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
                <Grid x:Name="radRichTextBoxParent">
                   <Grid.Resources>   

<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="4"/>
<ColumnDefinition MaxWidth="780" Width="Auto"/>
</Grid.ColumnDefinitions>
<telerik:DocumentRuler>
<telerik:RadRichTextBox x:Name="radRichTextBox"  IsSelectionMiniToolBarEnabled="True" IsSpellCheckingEnabled="True" IsContextMenuEnabled="True" LayoutMode="Paged"/>
</telerik:DocumentRuler>
<GridSplitter Background="{Binding Background, ElementName=TaskPane}" BorderThickness="1 0" Grid.Column="1" HorizontalAlignment="Stretch" Visibility="{Binding Visibility, ElementName=TaskPane}"/>
<telerik:TaskPane x:Name="TaskPane" AssociatedRichTextBox="{Binding ElementName=radRichTextBox}" Grid.Column="2" HorizontalAlignment="Stretch" MinWidth="265" VerticalAlignment="Stretch"/>
</Grid> 
                   <telerik:RadRichTextBoxRibbonUI x:Name="ribbon"> ...</telerik:RadRichTextBoxRibbonUI>
                   <telerik:RadRichTextBoxStatusBar />
                </Grid>
</UserControl>
```


**BrowserControl.xaml**

```
<UserControl x:Class="MyApp.BrowserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:MyApp"
             xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">

            <Grid x:Name="MainGrid">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="4*"/>
                    <ColumnDefinition Width="0*"/>
                </Grid.ColumnDefinitions>

                <wv2:WebView2 Name="webView"  Grid.Column="0" Grid.Row="0" Margin="0,0,6,0" />
                <GridSplitter x:Name="MainGridSplit" Visibility="Hidden" HorizontalAlignment="Right" Grid.RowSpan="3" MinWidth="5" MinHeight="5" Background="Blue"/>                
               **<local:WordControl x:Name="wordEditor" Grid.Column="1" Grid.Row="0" Margin="0,0,0,0" />**   

            </Grid>       

</UserControl>
```


**MainWindow.xaml**

```
<Window x:Class="MyApp.MyWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:MyApp"
        xmlns:controls="clr-namespace:MyApp.Controls"
        mc:Ignorable="d"
        ResizeMode="NoResize" WindowStartupLocation="CenterScreen" Loaded="Window_Loaded"
        WindowState="Maximized" WindowStyle="None" Background="#060531"
AllowsTransparency="False" Title="MyWindow" Height="450" Width="800">
    <Border CornerRadius="12">
        <Border.Background>
            <ImageBrush ImageSource="Images/back-image.jpg"
            Stretch="UniformToFill"/>
        </Border.Background>

        <Border CornerRadius="0" BorderThickness="2" Opacity="0.95">

            <Border.BorderBrush>
                <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                    <GradientStop Color="#462AD8" Offset="0"/>
                    <GradientStop Color="#DA34AE" Offset="0.75"/>
                    <GradientStop Color="#8A16C1" Offset="1"/>
                </LinearGradientBrush>
            </Border.BorderBrush>

            <Border.Background>
                <LinearGradientBrush StartPoint="0,1" EndPoint="1,0">
                    <GradientStop Color="#060531" Offset="0"/>
                    <GradientStop Color="#1B1448" Offset="1"/>
                </LinearGradientBrush>
            </Border.Background>

            <Grid>
               <Grid.RowDefinitions>
                 <RowDefinition Height="30"/>
                 <RowDefinition/>
               </Grid.RowDefinitions>

            **<local:BrowserControl x:Name="browserControl" Grid.Row="1" ></local:BrowserControl>**

            </Grid>

        </Border>

    </Border>
</Window>
```




I am expecting the WordControl should not be transparent.

                            
Murad
Top achievements
Rank 1
 updated question on 01 Apr 2024
1 answer
14 views

I have to scrub pasted fragments from web sources to remove any hyperlinks in those fragments but keep the text associated with the link if any.  I have tried the following code which gets the proper hyperlink elements, but this is not removing the hyperlink info.   Please let me know the proper method of finding all hyperlinks in the pasted document content and removing those links.  Thanks.


            var richTextBox = new RadRichTextBox();
            richTextBox.InsertFragment(document.Selection.CopySelectedDocumentElements());
            richTextBox.Document.Selection.SelectAll();

            var boxes = richTextBox.Document.Selection.GetSelectedBoxes().Where(b => b.AssociatedInline.FieldStart != null && b.AssociatedInline.FieldStart.GetType() == typeof(HyperlinkRangeStart));
            foreach (var box in boxes)
            {
                richTextBox.Document.CaretPosition.MoveToInline(box.AssociatedInline);
                richTextBox.RemoveHyperlink();
            }

Dimitar
Telerik team
 answered on 22 Mar 2024
2 answers
19 views

Hello,

 

Please reproduce:

1. Open Telerik Editor and enable Track change

 

2. Insert Hyperlink

 

3. Hyperlink added, but not marked as Inserted:

Note: Copy and Paste with hyperlink is working as Track Change

 

Is it a bug? How can it may be fixed? Any solution to fix it?

 

Thank you!

Dimitar
Telerik team
 answered on 13 Mar 2024
0 answers
28 views

Hello,

I'm using RadRichTextBox (WPF Telerik 2021.1.222.40) and get an error about my span's font can't cannot be italicized. From what I'm investigating, it seems like my FontFamily is specifying the style so I can't reassign the FontStyle. Some fonts where I am experiencing this problem: MS 明朝 Regular, MS Pゴシック Regular, A-OTF 新ゴ Pro B, A-OTF 新ゴ Pro EL... I assume it has to do with the suffixes behind the font names: Regular, B, EL

Has anyone else encountered this issue?

Thanks for your help.

This is the xaml content of RadRichTextBox:


<t:RadDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:t="clr-namespace:Telerik.Windows.Documents.Model;assembly=Telerik.Windows.Documents" xmlns:s="clr-namespace:Telerik.Windows.Documents.Model.Styles;assembly=Telerik.Windows.Documents" xmlns:r="clr-namespace:Telerik.Windows.Documents.Model.Revisions;assembly=Telerik.Windows.Documents" xmlns:n="clr-namespace:Telerik.Windows.Documents.Model.Notes;assembly=Telerik.Windows.Documents" xmlns:th="clr-namespace:Telerik.Windows.Documents.Model.Themes;assembly=Telerik.Windows.Documents" version="1.2" LayoutMode="Flow" LineSpacing="18.6700000762939" LineSpacingType="AtLeast" ParagraphDefaultSpacingAfter="0" ParagraphDefaultSpacingBefore="0" SectionDefaultPageMargin="73,79,72,64" SectionDefaultPageSize="816,1056" SelectedBibliographicStyleName="\APA.XSL" StyleName="defaultDocumentStyle">
  <t:RadDocument.Captions>
    <t:CaptionDefinition IsDefault="True" IsLinkedToHeading="False" Label="Figure" LinkedHeadingLevel="0" NumberingFormat="Arabic" SeparatorType="Hyphen" />
    <t:CaptionDefinition IsDefault="True" IsLinkedToHeading="False" Label="Table" LinkedHeadingLevel="0" NumberingFormat="Arabic" SeparatorType="Hyphen" />
  </t:RadDocument.Captions>
  <t:RadDocument.ProtectionSettings>
    <t:DocumentProtectionSettings EnableDocumentProtection="True" Enforce="False" HashingAlgorithm="None" HashingSpinCount="0" ProtectionMode="ReadOnly" />
  </t:RadDocument.ProtectionSettings>
  <t:RadDocument.Styles>
    <s:StyleDefinition DisplayName="Document Default Style" IsCustom="False" IsDefault="False" IsPrimary="True" Name="defaultDocumentStyle" Type="Default">
      <s:StyleDefinition.ParagraphStyle>
        <s:ParagraphProperties LineSpacing="18.6700000762939" LineSpacingType="AtLeast" SpacingAfter="0" TextAlignment="Justify" />
      </s:StyleDefinition.ParagraphStyle>
      <s:StyleDefinition.SpanStyle>
        <s:SpanProperties FontFamily="A-OTF ゴシックMB101 Pro U,MS Gothic" FontSize="14" FontStyle="Normal" FontWeight="Normal" />
      </s:StyleDefinition.SpanStyle>
    </s:StyleDefinition>
    <s:StyleDefinition DisplayName="Heading 1 Char" IsCustom="True" IsDefault="False" IsPrimary="False" LinkedStyleName="Heading1" Name="Heading1Char" Type="Character">
      <s:StyleDefinition.SpanStyle>
        <s:SpanProperties FontSize="18.6666660308838" FontWeight="Bold" ForeColor="#FF4F81BD" ThemeFontFamily="major" ThemeForeColor="accent1" />
      </s:StyleDefinition.SpanStyle>
    </s:StyleDefinition>
    <s:StyleDefinition DisplayName="Heading 2 Char" IsCustom="True" IsDefault="False" IsPrimary="False" LinkedStyleName="Heading2" Name="Heading2Char" Type="Character">
      <s:StyleDefinition.SpanStyle>
        <s:SpanProperties FontSize="17.3333339691162" FontWeight="Bold" ForeColor="#FF4F81BD" ThemeFontFamily="major" ThemeForeColor="accent1" />
      </s:StyleDefinition.SpanStyle>
    </s:StyleDefinition>
    <s:StyleDefinition DisplayName="Heading 3 Char" IsCustom="True" IsDefault="False" IsPrimary="False" LinkedStyleName="Heading3" Name="Heading3Char" Type="Character">
      <s:StyleDefinition.SpanStyle>
        <s:SpanProperties FontWeight="Bold" ForeColor="#FF4F81BD" ThemeFontFamily="major" ThemeForeColor="accent1" />
      </s:StyleDefinition.SpanStyle>
    </s:StyleDefinition>
    <s:StyleDefinition DisplayName="Heading 4 Char" IsCustom="True" IsDefault="False" IsPrimary="False" LinkedStyleName="Heading4" Name="Heading4Char" Type="Character">
      <s:StyleDefinition.SpanStyle>
        <s:SpanProperties FontStyle="Italic" FontWeight="Bold" ForeColor="#FF4F81BD" ThemeFontFamily="major" ThemeForeColor="accent1" />
      </s:StyleDefinition.SpanStyle>
    </s:StyleDefinition>
    <s:StyleDefinition DisplayName="Heading 5 Char" IsCustom="True" IsDefault="False" IsPrimary="False" LinkedStyleName="Heading5" Name="Heading5Char" Type="Character">
      <s:StyleDefinition.SpanStyle>
        <s:SpanProperties ForeColor="#FF4F81BD" ThemeFontFamily="major" ThemeForeColor="accent1" />
      </s:StyleDefinition.SpanStyle>
    </s:StyleDefinition>
    <s:StyleDefinition DisplayName="Heading 6 Char" IsCustom="True" IsDefault="False" IsPrimary="False" LinkedStyleName="Heading6" Name="Heading6Char" Type="Character">
      <s:StyleDefinition.SpanStyle>
        <s:SpanProperties FontStyle="Italic" ForeColor="#FF4F81BD" ThemeFontFamily="major" ThemeForeColor="accent1" />
      </s:StyleDefinition.SpanStyle>
    </s:StyleDefinition>
    <s:StyleDefinition DisplayName="Heading 7 Char" IsCustom="True" IsDefault="False" IsPrimary="False" LinkedStyleName="Heading7" Name="Heading7Char" Type="Character">
      <s:StyleDefinition.SpanStyle>
        <s:SpanProperties FontStyle="Italic" ForeColor="#FF000000" ThemeFontFamily="major" ThemeForeColor="text1" />
      </s:StyleDefinition.SpanStyle>
    </s:StyleDefinition>
    <s:StyleDefinition DisplayName="Heading 8 Char" IsCustom="True" IsDefault="False" IsPrimary="False" LinkedStyleName="Heading8" Name="Heading8Char" Type="Character">
      <s:StyleDefinition.SpanStyle>
        <s:SpanProperties FontSize="13.3333330154419" ForeColor="#FF000000" ThemeFontFamily="major" ThemeForeColor="text1" />
      </s:StyleDefinition.SpanStyle>
    </s:StyleDefinition>
    <s:StyleDefinition DisplayName="Heading 9 Char" IsCustom="True" IsDefault="False" IsPrimary="False" LinkedStyleName="Heading9" Name="Heading9Char" Type="Character">
      <s:StyleDefinition.SpanStyle>
        <s:SpanProperties FontSize="13.3333330154419" FontStyle="Italic" ForeColor="#FF000000" ThemeFontFamily="major" ThemeForeColor="text1" />
      </s:StyleDefinition.SpanStyle>
    </s:StyleDefinition>
    <s:StyleDefinition DisplayName="Normal" IsCustom="False" IsDefault="True" IsPrimary="True" Name="Normal" Type="Paragraph" />
    <s:StyleDefinition DisplayName="TableDefault" IsCustom="True" IsDefault="False" IsPrimary="True" Name="TableDefault" Type="Table">
      <s:StyleDefinition.ParagraphStyle>
        <s:ParagraphProperties LineSpacing="18.6700000762939" LineSpacingType="AtLeast" SpacingAfter="0" TextAlignment="Justify" />
      </s:StyleDefinition.ParagraphStyle>
      <s:StyleDefinition.TableStyle>
        <s:TableProperties Borders="1,Single,#FF000000,none,,">
          <s:TableProperties.TableLook>
            <t:TableLook />
          </s:TableProperties.TableLook>
        </s:TableProperties>
      </s:StyleDefinition.TableStyle>
    </s:StyleDefinition>
    <s:StyleDefinition DisplayName="TableNormal" IsCustom="False" IsDefault="True" IsPrimary="True" Name="TableNormal" Type="Table" />
    <s:StyleDefinition DisplayName="TitleLevel1" IsCustom="True" IsDefault="False" IsPrimary="True" Name="TitleLevel1" Type="Paragraph">
      <s:StyleDefinition.ParagraphStyle>
        <s:ParagraphProperties LeftIndent="0" LineSpacing="24" LineSpacingType="AtLeast" SpacingAfter="0" SpacingBefore="0" />
      </s:StyleDefinition.ParagraphStyle>
      <s:StyleDefinition.SpanStyle>
        <s:SpanProperties FontFamily="MS Gothic" FontSize="18.6700000762939" />
      </s:StyleDefinition.SpanStyle>
    </s:StyleDefinition>
    <s:StyleDefinition DisplayName="TitleLevel2" IsCustom="True" IsDefault="False" IsPrimary="True" Name="TitleLevel2" Type="Paragraph">
      <s:StyleDefinition.ParagraphStyle>
        <s:ParagraphProperties LeftIndent="0" LineSpacing="24" LineSpacingType="AtLeast" SpacingAfter="0" SpacingBefore="0" />
      </s:StyleDefinition.ParagraphStyle>
      <s:StyleDefinition.SpanStyle>
        <s:SpanProperties FontFamily="MS Gothic" FontSize="18.6700000762939" />
      </s:StyleDefinition.SpanStyle>
    </s:StyleDefinition>
    <s:StyleDefinition DisplayName="TitleLevel3" IsCustom="True" IsDefault="False" IsPrimary="True" Name="TitleLevel3" Type="Paragraph">
      <s:StyleDefinition.ParagraphStyle>
        <s:ParagraphProperties LeftIndent="0" LineSpacing="24" LineSpacingType="AtLeast" SpacingAfter="0" SpacingBefore="0" />
      </s:StyleDefinition.ParagraphStyle>
      <s:StyleDefinition.SpanStyle>
        <s:SpanProperties FontFamily="MS Mincho" FontSize="16" />
      </s:StyleDefinition.SpanStyle>
    </s:StyleDefinition>
    <s:StyleDefinition DisplayName="TitleLevel4" IsCustom="True" IsDefault="False" IsPrimary="True" Name="TitleLevel4" Type="Paragraph">
      <s:StyleDefinition.ParagraphStyle>
        <s:ParagraphProperties LeftIndent="0" LineSpacing="21.3299999237061" LineSpacingType="AtLeast" SpacingAfter="0" SpacingBefore="0" />
      </s:StyleDefinition.ParagraphStyle>
      <s:StyleDefinition.SpanStyle>
        <s:SpanProperties FontFamily="MS Mincho" FontSize="14" />
      </s:StyleDefinition.SpanStyle>
    </s:StyleDefinition>
    <s:StyleDefinition DisplayName="TitleLevel5" IsCustom="True" IsDefault="False" IsPrimary="True" Name="TitleLevel5" Type="Paragraph">
      <s:StyleDefinition.ParagraphStyle>
        <s:ParagraphProperties LeftIndent="0" LineSpacing="21.3299999237061" LineSpacingType="AtLeast" SpacingAfter="0" SpacingBefore="0" />
      </s:StyleDefinition.ParagraphStyle>
      <s:StyleDefinition.SpanStyle>
        <s:SpanProperties FontFamily="MS Mincho" FontSize="14" />
      </s:StyleDefinition.SpanStyle>
    </s:StyleDefinition>
    <s:StyleDefinition DisplayName="TitleLevel6" IsCustom="True" IsDefault="False" IsPrimary="True" Name="TitleLevel6" Type="Paragraph">
      <s:StyleDefinition.ParagraphStyle>
        <s:ParagraphProperties LeftIndent="0" LineSpacing="21.3299999237061" LineSpacingType="AtLeast" SpacingAfter="0" SpacingBefore="0" />
      </s:StyleDefinition.ParagraphStyle>
      <s:StyleDefinition.SpanStyle>
        <s:SpanProperties FontFamily="MS Mincho" FontSize="14" />
      </s:StyleDefinition.SpanStyle>
    </s:StyleDefinition>
    <s:StyleDefinition DisplayName="TitleLevel7" IsCustom="True" IsDefault="False" IsPrimary="True" Name="TitleLevel7" Type="Paragraph">
      <s:StyleDefinition.ParagraphStyle>
        <s:ParagraphProperties LeftIndent="0" LineSpacing="21.3299999237061" LineSpacingType="AtLeast" SpacingAfter="0" SpacingBefore="0" />
      </s:StyleDefinition.ParagraphStyle>
      <s:StyleDefinition.SpanStyle>
        <s:SpanProperties FontFamily="MS Mincho" FontSize="14" />
      </s:StyleDefinition.SpanStyle>
    </s:StyleDefinition>
    <s:StyleDefinition DisplayName="TitleLevel8" IsCustom="True" IsDefault="False" IsPrimary="True" Name="TitleLevel8" Type="Paragraph">
      <s:StyleDefinition.ParagraphStyle>
        <s:ParagraphProperties LeftIndent="0" LineSpacing="21.3299999237061" LineSpacingType="AtLeast" SpacingAfter="0" SpacingBefore="0" />
      </s:StyleDefinition.ParagraphStyle>
      <s:StyleDefinition.SpanStyle>
        <s:SpanProperties FontFamily="MS Mincho" FontSize="14" />
      </s:StyleDefinition.SpanStyle>
    </s:StyleDefinition>
    <s:StyleDefinition DisplayName="TitleLevel9" IsCustom="True" IsDefault="False" IsPrimary="True" Name="TitleLevel9" Type="Paragraph">
      <s:StyleDefinition.ParagraphStyle>
        <s:ParagraphProperties LeftIndent="0" LineSpacing="21.3299999237061" LineSpacingType="AtLeast" SpacingAfter="0" SpacingBefore="0" />
      </s:StyleDefinition.ParagraphStyle>
      <s:StyleDefinition.SpanStyle>
        <s:SpanProperties FontFamily="MS Mincho" FontSize="14" />
      </s:StyleDefinition.SpanStyle>
    </s:StyleDefinition>
  </t:RadDocument.Styles>
  <t:Section PageSize="793.700805664063,1122.51965332031">
    <t:Paragraph Background="#FFD8D6CB" StyleName="TitleLevel1">
      <t:ReadOnlyRangeStart AnnotationID="1" />
      <t:Span Tag="[INDEX_SID:3295715,DOC_DATA_SID:2646844]" Text="てきすと" />
    </t:Paragraph>
    <t:Paragraph FirstLineIndent="-12" FontSize="12" LeftIndent="33.3300018310547" LineSpacing="16" LineSpacingType="AtLeast" RightIndent="0" SpacingAfter="4" SpacingBefore="0" TextAlignment="Justify">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties BaselineAlignment="Baseline" FontFamily="MS Pゴシック Regular,MS PGothic" FontSize="12" FontStyle="Normal" ForeColor="#FF000000" UnderlineDecoration="None" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
      <t:ReadOnlyRangeEnd AnnotationID="1" />
      <t:Span BaselineAlignment="Baseline" FontFamily="MS Pゴシック Regular,MS PGothic" FontSize="12" FontStyle="Normal" ForeColor="#FF000000" Text="*" UnderlineDecoration="None" />
      <t:Span BaselineAlignment="Baseline" FontFamily="MS 明朝 Regular,MS Mincho" FontSize="12" FontStyle="Normal" ForeColor="#FF000000" Text="少額" UnderlineDecoration="None" />
      <t:Span BaselineAlignment="Baseline" FontFamily="MS 明朝 Regular,MS Mincho" FontSize="12" FontStyle="Italic" ForeColor="#FF000000" Text="貯蓄非" UnderlineDecoration="None" />
      <t:Span BaselineAlignment="Baseline" FontFamily="MS 明朝 Regular,MS Mincho" FontSize="12" FontStyle="Normal" ForeColor="#FF000000" Text="課税制度" UnderlineDecoration="None" />
      <t:Span BaselineAlignment="Baseline" FontFamily="MS Pゴシック Regular,MS PGothic" FontSize="12" FontStyle="Normal" ForeColor="#FF000000" Text="(マル優)" UnderlineDecoration="None" />
      <t:Span BaselineAlignment="Baseline" FontFamily="MS ゴシック Regular,MS Gothic" FontSize="12" FontStyle="Normal" ForeColor="#FF000000" Text="をご利用いただけます" UnderlineDecoration="None" />
      <t:Span BaselineAlignment="Baseline" FontFamily="MS Pゴシック Regular,MS PGothic" FontSize="12" FontStyle="Normal" ForeColor="#FF000000" Text="。詳しくは販売会社にお問い合わせください。" UnderlineDecoration="None" />
    </t:Paragraph>
  </t:Section>
</t:RadDocument>

Tran
Top achievements
Rank 1
 asked on 06 Dec 2023
1 answer
43 views
Hi!
I want to be able to change themes and am setting the Background of RadRichTextBox to a DynamicResource.
That works, but when I set the Foreground to a DynamicResource the color changes only on text changed.

I want the default Foreground to change automatically.

I've attached a project 
Stenly
Telerik team
 answered on 26 Oct 2023
1 answer
60 views

Hello Everyone,

I am currently Testing if we can switch from Word to Telerik RadRichTextbox. For that i want to be able to get notifications/events when a User Clicks on a Checkbox. I know there is the DocumentContentChanged event but that fires always and i dont think that ist viable for a document with many Checkboxes.

Is there some Event that would tell me which Control was changed?

Dimitar
Telerik team
 answered on 24 Oct 2023
1 answer
33 views

Hello,

Can I use any method to clone RadDocument.

Before I`ve used Export -> Import using DocxFormatProvider. But this practic sometime return error (when TrackChange enabled and images were removed, then export ok, but import return MergeBoxNodes Nullreference error).

I just need to clone RadDocument to store second variant without the changes (clone and accept all changes).

Any ideas?

Dimitar
Telerik team
 answered on 25 Sep 2023
1 answer
72 views

Hello. 

I am using custom field extends on CodeBasedField. This field fetch some data form database or prompt window on request. Sometimes its simple string, some time its rft string. I face with problem on handling rft strings. Here is how its looks like in "Code" mode:

Here is how I handle result value of field:

protected override DocumentFragment GetResultFragment()
    {
        var text = "";
        /* 
        text = fetch string handle here
        */
        if (!text.StartsWith(@"{\rtf"))
        {
            var document = new RtfFormatProvider().Import(text);
            return new DocumentFragment(document);
        }
        return CreateFragmentFromText(text);
    }

And if 'text' is rtf the "Result" mode is this:

You can see that extra line breaking there.

I am sure that my rtf have no extra line breaking or paragraphs. As well as "SpacingAfter" parameter for paragraph is 0.

The reason of it is how code handle Paragraphs.

Here is some code from Telerik lib:

How fragment created from document:

How Fragment inserted in RadDocument:

The code inserts "line break" after Paragraph if its single in fragment and if "IsLastParagraphClosed" is true. I cant change value of "IsLastParagraphClosed" because its setter is internal. 

Same problem if my rtf has more then one Paragraph. In that case it use another flow in InsertFragmentInternal method but the result is same - extra line breaking after Field.

 

I found workaround to skip this line breaking, create fragment not from RadDocument but from Selection:

protected override DocumentFragment GetResultFragment()
    {
        var text = "";
        /* 
        text = fetch string handle here
        */
        if (!text.StartsWith(@"{\rtf"))
        {
            var document = new RtfFormatProvider().Import(text);
            document.Selection.SelectAll();
            return new DocumentFragment(document.Selection);
        }
        return CreateFragmentFromText(text);
    }

But in this case its not reproduce full text formatting (e.g. TextAlingment) for my rtf.

Please help me to find proper workaround or fix this issue.

Dimitar
Telerik team
 answered on 11 Sep 2023
0 answers
29 views

Sometimes when I paste a test intro en empty RadMaskedTextInput, the application crushes and the following error occurs:

 

FATAL Index was out of range. Must be non-negative and less than the size of the collection.

Parameter name: index

                at System.Text.StringBuilder.Remove(Int32 startIndex, Int32 length)

   at Telerik.Windows.Controls.RadMaskedTextInput.HandlePasteNoMask(Object value, Object& returnString)

   at Telerik.Windows.Controls.RadMaskedTextInput.HandlePasteOverride(Object value, Object& returnString)

   at Telerik.Windows.Controls.RadMaskedInputBase.HandlePaste()

   at Telerik.Windows.Controls.RadMaskedInputBase.OnApplicationPaste(Object sender, ExecutedRoutedEventArgs e)

   at System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)

   at System.Windows.Input.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)

   at System.Windows.Input.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)

   at System.Windows.Input.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)

   at System.Windows.Input.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)

   at System.Windows.UIElement.OnExecutedThunk(Object sender, ExecutedRoutedEventArgs e)

   at System.Windows.Input.ExecutedRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)

   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)

  at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)

   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)

   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)

   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)

   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)

   at System.Windows.Input.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)

   at System.Windows.Input.RoutedCommand.ExecuteCore(Object parameter, IInputElement target, Boolean userInitiated)

   at System.Windows.Input.CommandManager.TranslateInput(IInputElement targetElement, InputEventArgs inputEventArgs)

   at System.Windows.UIElement.OnKeyDownThunk(Object sender, KeyEventArgs e)

   at System.Windows.Input.KeyEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)

   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)

   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)

   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)

   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)

   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)

   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)

   at System.Windows.Input.InputManager.ProcessStagingArea()

   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)

   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)

   at System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawKeyboardActions actions, Int32 scanCode, Boolean isExtendedKey, Boolean isSystemKey, Int32 virtualKey)

   at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled)

   at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG& msg, ModifierKeys modifiers)

   at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)

   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)


Narrow your results
Selected tags
Tags
+? more
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?