ContextMenu Hyperlink in RadRichTextBox WPF

[亡魂溺海] 提交于 2019-12-25 09:28:14

问题


When i add a Physical path in a Hyperlink from ContextMenu of RadRichTextBox i see http:// getting added extra but in only in one scenario.

  1. I tried adding the link like below(The folder name has no spaces at the last),

the above gives me correct URL.

  1. When i add the link with a folder which as spaces at the last like,

I get the output like below when i edit the Hyperlink and see,

//XAML

     <telerik:RadRichTextBox x:Name="ss" Grid.Column="0" Grid.Row="1" telerik:StyleManager.Theme="Windows8" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" FontWeight="Normal" AcceptsTab="True" telerik:HtmlDataProvider.Source="{Binding Notes, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsSpellCheckingEnabled="True"  HyperlinkClicked="ritFnBNotes_HyperlinkClicked"   DocumentInheritsDefaultStyleSettings="True" Height="150" CommandExecuting="ritNotes_CommandExecuting" IsReadOnly="{Binding EnableForEdit, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource InverseBool}}" DocumentContentChanged="Notes_DocumentContentChanged">
     <telerik:RadRichTextBox.SelectionMiniToolBar >                                                     <telerik:SelectionMiniToolBar telerik:StyleManager.Theme="Windows8" />
     </telerik:RadRichTextBox.SelectionMiniToolBar>                                                <telerik:RadRichTextBox.Document>
         <telerik:RadDocument>
      <telerik:Section>
      <telerik:Paragraph FontSize="8" LineSpacing="0" LineSpacingType="Exact"></telerik:Paragraph>
     </telerik:Section>
      </telerik:RadDocument>    
 </telerik:RadRichTextBox.Document>
     <i:Interaction.Triggers>
     <i:EventTrigger EventName="DocumentContentChanged">
     <i:InvokeCommandAction Command="{Binding FnBNoteChangeCommand, Mode=OneWay}"/>
      </i:EventTrigger>
     </i:Interaction.Triggers>
     </telerik:RadRichTextBox>

I'm not sure how does the http:// append into the URL where i upload a physical path. Now i need to get rid of the http://.

Someone help me with this.


回答1:


I am afraid this is a known issue with RadInsertHyperlinkDialog. When the URL doesn't match a regular expression, an "http://" is added to the string.

As suggested by the official Telerik support, you could create a custom dialog to work around this behaviour. Please refer to the following link for more information: http://www.telerik.com/forums/radrichtextbox-hyperlink-dialog-issue



来源:https://stackoverflow.com/questions/43115620/contextmenu-hyperlink-in-radrichtextbox-wpf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!