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

RadRichTextBox in lightswitch - simple solution

2 Answers 66 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Gregory
Top achievements
Rank 1
Gregory asked on 04 May 2015, 07:32 PM

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" />
</Grid>

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

Thanks in advance,
Greg

2 Answers, 1 is accepted

Sort by
0
Accepted
Tanya
Telerik team
answered on 05 May 2015, 03:59 PM
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.

Regards,
Tanya
Telerik
 

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

 
0
Gregory
Top achievements
Rank 1
answered on 06 May 2015, 02:42 PM
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.
Tags
RichTextBox
Asked by
Gregory
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Gregory
Top achievements
Rank 1
Share this question
or