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

[Solved] RichTextbox dissappearing text and cursor problem

2 Answers 211 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Alexey
Top achievements
Rank 1
Alexey asked on 02 Dec 2010, 07:16 PM

Hi, can you please help me with with questions:

  1) When double click on empty textbox area (not on the text), the text disappears. There is a feeling that it “scrolls” to the left. If you try to select it by dragging mouse to the left, it appears again.

2) If the binded text is displayed in several lines, it’s impossible to put cursor to the second/third/etc. line. It is positioned correctly on X-axis,  but stays at the first line.

3) If the spellcheck dictionary is stored to client’s isolated storage, adding the word to dictionary doesn’t refresh underlines. Only when the form with RadRichTextBox is opened again, the added word is not underlined anymore.

Markup:

 

<Grid x:Name="LayoutRoot" Background="White">
        <Grid.Resources>
            <documentsXaml:TxtDataProvider x:Key="txtDataProvider"
               RichTextBox="{Binding ElementName=txtQuestion}"
               Text="{Binding Text, Mode=TwoWay}"
               SetupDocument="TxtDataProvider_SetupDocument"
               />
        </Grid.Resources>
        <Border Width="510" Height="100" BorderThickness="1" BorderBrush="Black">
            <telerikDocuments:RadRichTextBox
                x:Name="txtQuestion"
                IsSpellCheckingEnabled="True"
                IsSelectionMiniToolBarEnabled="False"
                VerticalScrollBarVisibility="Auto"
                HorizontalScrollBarVisibility="Disabled"
                IsEnabled="True"
                DocumentInheritsDefaultStyleSettings="True"
                />
        </Border>
    </Grid>

Codebehind:
public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
            DataContext = new ViewModel();
        }
  
        private void TxtDataProvider_SetupDocument(object sender, Telerik.Windows.Documents.FormatProviders.SetupDocumentEventArgs e)
        {
            e.Document.LayoutMode = DocumentLayoutMode.Flow;
            e.Document.ParagraphDefaultSpacingAfter = 0;
            e.Document.PageViewMargin = new SizeF(0, 0);
            e.Document.SectionDefaultPageMargin = new Padding(6);
        }
    }

Viewmodel:
public class ViewModel : INotifyPropertyChanged
    {
        private string _text;
        public string Text
        {
            get { return _text; }
            set
            {
                _text = value;
                NotifyPropertyChanged("Text");
            }
        }
  
        public ViewModel()
        {
            Text = "askljdhglkjashdgkl jasdjgkl hasljk ghjasklhd glhsgkljas gjklash gjklhsdg iuo hsdiguahsd ghskdlghjsdh gkljsd gkljasd gljsdgpasd gklhsdgl hslg ahsdg";
        }
  
        public event PropertyChangedEventHandler PropertyChanged;
        protected void NotifyPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }

2 Answers, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 06 Dec 2010, 03:21 PM
Hello Alexey,

Issues 1 and 2 were bugs in TxtFormatProvider, but have now been resolved. We have also dealt with the problem concerning the SpellChecker which you have pointed out. The changes will be visible in the next internal build, which is due any day now. You can download it from the Internal Builds Downloads section in your account.

If you have any other questions, do not hesitate to contact us again.

Greetings,
Iva
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Accepted
Iva Toteva
Telerik team
answered on 06 Dec 2010, 05:57 PM
Hi Alexey,

I am sorry for misinforming you. Actually, the fixes in TxtFormatProvider will be visible in the Service Pack, which is due in mid-December and not the next internal build. You can try using HtmlFormatProvider (or HtmlDataProvider) as a workaround until then.

Best wishes,
Iva
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
RichTextBox
Asked by
Alexey
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Share this question
or