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

No red wavy underlines with txtDataProvider

7 Answers 159 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Shaun
Top achievements
Rank 1
Shaun asked on 21 Aug 2012, 02:55 PM
Hello,

I'm utilizing the spell check functionality of the RadRichTextbox control with text bound from my viewModel using the txtDataProvider.  The issue I'm having is I am not seeing any red wavy underlines with misspelled words.  If I right-click on text, it will recommend corrections but I need the red wavy lines to display the incorrect words.

<telerik:RadRichTextBox x:Name="radRichTextBox1" Padding="2" BorderBrush="#FF333333" Margin="6,6,6,6" Height="25" Width="924" DocumentInheritsDefaultStyleSettings="True" >
                            <telerik:RadRichTextBox.Resources>
                                <telerikDocs:TxtDataProvider x:Key="txtDataProvider1" RichTextBox="{Binding ElementName=radRichTextBox1}" Text="{Binding AuditOverview.Feedback[0].Text, Mode=TwoWay}" />                               
                            </telerik:RadRichTextBox.Resources>
                        </telerik:RadRichTextBox>

Also, how can I get the length of the text entered in the richtextbox?
 
Thank you

7 Answers, 1 is accepted

Sort by
0
Shaun
Top achievements
Rank 1
answered on 21 Aug 2012, 06:36 PM
Another thing to add:

Since my previous post, I have changed my code to use the HTMLDataProvider and convert the text within the control using the TxtDataProvider in the code-behind (ugh - since I'm using MVVM).  Now I am not seeing the red wavy lines if i type a misspelled word into a radrichtextbox that already has text with no spelling mistakes. 

Steps:
Load radControl with text from viewModel object with spelling mistakes
RadControl will have red wavy lines with populated text and any new text entered

Load radControl with empty string or null from viewModel object
RadControl will have red wavy lines with any new text entered.

Load radControl with text from viewModel object without spelling mistakes
RadControl will not have red wavy lines with any new text entered 

Code in XAML
<telerik:RadRichTextBox x:Name="radRichTextBox1" Padding="2" BorderBrush="#FF333333" Margin="6,6,6,0" Height="25" Width="924" DocumentInheritsDefaultStyleSettings="True" KeyUp="radRichTextBox_KeyUp" >
                            <telerik:RadRichTextBox.Resources>                               
                                <telerikHTML:HtmlDataProvider x:Key="htmlDataProvider1" RichTextBox="{Binding ElementName=radRichTextBox1}" Html="{Binding AuditOverview.Feedback[0].Text, Mode=TwoWay}" />
                            </telerik:RadRichTextBox.Resources>
                        </telerik:RadRichTextBox>
0
Petya
Telerik team
answered on 23 Aug 2012, 06:46 AM
Hi Shaun,

We tried to reproduce the issue with missing underlines, but to no avail. Could you please try isolate it in a sample project and attach it to a support ticket?

Regarding your other question - you can get the length of the text using TxtFormatProvider as follows:

int textLength = newTxtFormatProvider().Export(radRichTextBox1.Document).Length;
Note that this will count only characters and not images, tables, etc, also it could be slow with larger documents.

As a side note, the best practice is to put the data providers directly in the visual tree insted of in the resources - this way its data context will be properly updated on change.

Looking forward to your reply.
All the best,
Petya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Shaun
Top achievements
Rank 1
answered on 23 Aug 2012, 03:32 PM
I was able to isolate and replicate the issue.  My sample project has been added to my support ticket. 

Silverlight 4 project
Telerik Binary Version: 2012.1.326.1040 
0
Accepted
Petya
Telerik team
answered on 27 Aug 2012, 11:51 AM
Hi Shaun,

Thank you for the sample project!

We confirmed the bug with the version of the controls you specified. Fortunately, this issue was fixed in the 2012 Q2 release. If you upgrade to that or a later version of the controls (2012 Q2 SP1), everything should work as expected.

Please, do not hesitate to get back to us if you have additional questions.

Regards,
Petya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Shaun
Top achievements
Rank 1
answered on 27 Aug 2012, 01:21 PM
Will those binaries be compatible with SL4 projects?  I was told I needed to use this version of the RadControls because of a previous issue.
0
Shaun
Top achievements
Rank 1
answered on 29 Aug 2012, 05:48 PM
Downloaded the SL4 only DLLs for v2012.2.725.1040 and that resolved the issue with no red wavy lines for textboxes without errors.

New issue (sorry):  red wavy lines do not show up if incorrect word has a number in it (ex. asdads777asd).
0
Petya
Telerik team
answered on 30 Aug 2012, 12:59 PM
Hello Shaun,

I am glad your previous issue was resolved.

As for words containing a number, the behavior you are observing is the one by design. This is also the default behavior in MS Word.
We have logged a request for customization option in our to-do list and will consider implementing such a feature, though I cannot engage with a particular time-frame.

Thank you for the suggestion!

Regards,
Petya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
RichTextBox
Asked by
Shaun
Top achievements
Rank 1
Answers by
Shaun
Top achievements
Rank 1
Petya
Telerik team
Share this question
or