RichTextBox cannot display correctly

2 posts, 0 answers
  1. Ning
    Ning avatar
    21 posts
    Member since:
    Nov 2016

    Posted 18 Sep Link to this post

    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.

     

     

     

     

  2. Tanya
    Admin
    Tanya avatar
    577 posts

    Posted 20 Sep Link to this post

    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.
Back to Top