No red wavy underlines with txtDataProvider

8 posts, 1 answers
  1. Shaun
    Shaun avatar
    6 posts
    Member since:
    Jul 2012

    Posted 21 Aug 2012 Link to this post

    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
  2. Shaun
    Shaun avatar
    6 posts
    Member since:
    Jul 2012

    Posted 21 Aug 2012 Link to this post

    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>
  3. DevCraft banner
  4. Petya
    Admin
    Petya avatar
    975 posts

    Posted 23 Aug 2012 Link to this post

    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.

  5. Shaun
    Shaun avatar
    6 posts
    Member since:
    Jul 2012

    Posted 23 Aug 2012 Link to this post

    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 
  6. Answer
    Petya
    Admin
    Petya avatar
    975 posts

    Posted 27 Aug 2012 Link to this post

    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.

  7. Shaun
    Shaun avatar
    6 posts
    Member since:
    Jul 2012

    Posted 27 Aug 2012 Link to this post

    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.
  8. Shaun
    Shaun avatar
    6 posts
    Member since:
    Jul 2012

    Posted 29 Aug 2012 Link to this post

    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).
  9. Petya
    Admin
    Petya avatar
    975 posts

    Posted 30 Aug 2012 Link to this post

    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.

Back to Top
DevCraft banner