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

RichTextBox cannot display correctly

1 Answer 150 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Ning
Top achievements
Rank 1
Ning asked on 19 Sep 2017, 03:02 AM

Dear Telerik Team

I just faced an issue about displaying RichTextBox failed.

I would like to edit comment for validation process with RichTextbox in a window that customized by myself inherits by System.Windows.Window.

and I put a Grid as RichTextBox container, the Xaml code is as follow:

<Grid>

    <Grid.RowDefinitions>

        <RowDefinition Height="Auto"/>

        <RowDefinition Height="*"/>

   </Grid.RowDefinitions>

   <telerik:RadRichTextBox Grid.Row="1"  x:Name="myRichTextBox" />

   <telerik:RadRichTextBoxRibbonUI ApplicationName="{x:Null}" TitleBarVisibility="Collapsed"  Title="{x:Null}"  ApplicationButtonVisibility="Collapsed" Grid.Row="0" DataContext="{Binding Commands,Element=myRichTextBox"}>

<....>//Only one RibbonTab added here with two RibbonButtonGroup for Paragraph and Font Editing

   </telerik:RadRichTextBoxRibbonUI>

</Grid>

 

and Added Loaded Event is as follow:

   private void Example_Loaded(object sender, RoutedEventArgs e)
   {

       this.myRichTextBox.Document=new RadDocument();

       this.myRichTextBox.Document.LayoutMode=DocumentLayoutMode.Flow;

   }

and the result is that no RibbonRichTextBoxUI and RichTextBox displayed, only blank area showed in my window.

Telerik dll version is 2014.1.411.45.

Kindly help me, thanks a lot.

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 20 Sep 2017, 01:06 PM
Hello Ning,

A similar behavior could be observed when the project refers the assemblies from the NoXaml folder instead of the regular ones. Could you please verify that the references are pointing to the right location?

Something I noticed in the code snippet from your post is that the DataContext binding is using Element to specify the RadRichTextBox instance name. It should be ElementName instead:
<telerik:RadRichTextBoxRibbonUI ApplicationName="{x:Null}" TitleBarVisibility="Collapsed"  Title="{x:Null}"  ApplicationButtonVisibility="Collapsed" Grid.Row="0" DataContext="{Binding Commands, Element=myRichTextBox}">

Hope this is helpful.

Regards,
Tanya
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
RichTextBox
Asked by
Ning
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Share this question
or