RadRichTextBox in lightswitch - simple solution

3 posts, 1 answers
  1. Gregory
    Gregory avatar
    2 posts
    Member since:
    Apr 2015

    Posted 04 May 2015 Link to this post

    I have to be missing something. Trying to use RadRichTextBox in LightSwitch. LS screen is getting a binary as a parameter (screen variable) that is a MS Word docx file. I need to get that into the custom Silverlight control that is the RadRichTextBox. Custom control is on the LS screen. And here is my xaml of the Silverlight control.

    <Grid x:Name="LayoutRoot" Background="White" Margin="0,0,0,0">
            <telerik:DocxDataProvider Docx="{Binding ElementName=Screen.myBinaryFile}" RichTextBox="{Binding ElementName=radRichTextBox}" />
            <telerik:RadRichTextBox x:Name="radRichTextBox" DocumentInheritsDefaultStyleSettings="True" Height="60"
                 HorizontalScrollBarVisibility="Hidden" IsSelectionMiniToolBarEnabled="True" IsReadOnly="True" 
                 IsSpellCheckingEnabled="False" IsContextMenuEnabled="True" VerticalScrollBarVisibility="Hidden" Width="800" FontSize="10" />

     This is pretty simple stuff but I seem to be missing something.

    Thanks in advance,

  2. Answer
    Tanya avatar
    577 posts

    Posted 05 May 2015 Link to this post

    Hello Gregory,

    I tested the scenario on our end and couldn't replicate a problem. From the code-snippet you have posted I could suggest to verify that the binding of the Docx property is correct.

    I am sending you the project I tested with - there is a GetFile button in the Screen Command Bar, which loads the file in the RadRichTextBox. Please check it and let me know if you are still experiencing issues with this. 

    Hope this helps.


    See What's Next in App Development. Register for TelerikNEXT.

  3. Gregory
    Gregory avatar
    2 posts
    Member since:
    Apr 2015

    Posted 06 May 2015 in reply to Tanya Link to this post

    Thanks your code helped greatly.  Issue was with the bindings. Example here: Docx="{Binding ElementName=Screen.myBinaryFile}" is NOT correct. Changed to Docx="{Binding Screen.myBinaryFile}" works great. Thanks again.
Back to Top