Runtime problem with RadDocument's DocumentContentChangedInterval deign time property

6 posts, 0 answers
  1. Pawan
    Pawan avatar
    7 posts
    Member since:
    Mar 2012

    Posted 21 Mar 2012 Link to this post

    Hello ,
    I developed a rich text box user control fro my application purpose. However, for each form or user control I added it, a code block is getting added automatically in designer file. Following is the code block:
    radDocument1.DefaultStyleSettings = styleDefinition1;
    radDocument1.DocumentContentChangedInterval = System.TimeSpan.Parse("00:00:00.0000100");
    radDocument1.HyperlinkNavigationMode = Telerik.WinControls.RichTextBox.HyperlinkNavigationMode.CtrlClick;
    radDocument1.HyperlinkToolTipFormatString = "{0}\r\n{1} to follow link";
    .......
    The main problem is with the statement radDocument1.DocumentContentChangedInterval = System.TimeSpan.Parse("00:00:00.1000100");
    This line causes a run time exception saying the interval should not be zero.
    However, if I try to change the value, it gets automatically reset every time if a deign change occur on form/control.
    So, I need to look for this entry and change it to some non-zero value before every run.

    Please help me out to get rid if it.

    Thanks
    --Pawan
  2. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 23 Mar 2012 Link to this post

    Hi Pawan,

    Thank you for contacting us.

    The Document property of RadRichTextBox is not serializable at design time and you cannot change it from design time. That is why this issue looks strange. Could you please confirm that you are using RadControls for WinForms. If your issue is related with the WPF/Silverlight version of the editor, please direct your question to the appropriate forum. However, if you are using WinForms, please send us your source code and we will investigate this issue in detail.

    I am looking forward to your reply.
     
    Greetings,
    Jack
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Pawan
    Pawan avatar
    7 posts
    Member since:
    Mar 2012

    Posted 26 Mar 2012 Link to this post

    Hi Jack,

    I am using Telerik Controls for WinForms (Q2 2011). Today, I added my existing RichTextBox user control to an another user control. The following lines of code gets added automatically to the designer file of parent user control:

    radDocument1.Cursor = System.Windows.Forms.Cursors.IBeam;
    pageLayoutSettings1.Height = 1056F;
    pageLayoutSettings1.Width = 816F;
    radDocument1.DefaultPageLayoutSettings = pageLayoutSettings1;
    styleDefinition1.BasedOn = null;
    radDocument1.DefaultStyleSettings = styleDefinition1;
    radDocument1.DocumentContentChangedInterval = System.TimeSpan.Parse("00:00:00.0000100");
    radDocument1.HyperlinkNavigationMode = Telerik.WinControls.RichTextBox.HyperlinkNavigationMode.CtrlClick;
    radDocument1.HyperlinkToolTipFormatString = "{0}\r\n{1} to follow link";
    radDocument1.IsSpellCheckingEnabled = true;
    radDocument1.LayoutMode = Telerik.WinControls.RichTextBox.Model.DocumentLayoutMode.Flow;
    radDocument1.LineSpacing = 1.15D;
    radDocument1.LineSpacingType = Telerik.WinControls.RichTextBox.Model.LineSpacingType.Auto;
    radDocument1.Lists = ((System.Collections.Generic.List<Telerik.WinControls.RichTextBox.Model.ListSerializationData>)(resources.GetObject("radDocument1.Lists")));
    radDocument1.ListStyles = ((System.Collections.Generic.List<Telerik.WinControls.RichTextBox.Model.ListStyle>)(resources.GetObject("radDocument1.ListStyles")));
    radDocument1.PageViewMargin = new System.Drawing.SizeF(10F, 10F);
    radDocument1.ParagraphDefaultSpacingAfter = 12F;
    radDocument1.ParagraphDefaultSpacingBefore = 0F;
    radDocument1.SectionDefaultPageMargin = new System.Windows.Forms.Padding(95);
    radDocument1.SectionDefaultPageOrientation = Telerik.WinControls.RichTextBox.Model.PageOrientation.Portrait;
    radDocument1.ShowFormattingSymbols = false;


    With the property value System.TimeSpan.Parse("00:00:00.0000100");, if i try open the design view of user control, it shows error. The respected view is attached as an image.
    Now, when I try to run the code with given value for this property, it throws an exception with following stack trace:

     at System.Windows.Forms.Timer.set_Interval(Int32 value)
       at Telerik.WinControls.RichTextBox.Utils.DelayedExecution.set_WaitInterval(TimeSpan value)
       at Telerik.WinControls.RichTextBox.Model.RadDocument.set_DocumentContentChangedInterval(TimeSpan value)
       at TheraCall.NextGen.UI.UserControls.InformationBarControl.InitializeComponent() in F:\Projects\TheraCallNextGenNewSolution-3-30-branch\TheraCall.NextGen.UI\UserControl\InformationBarControl.Designer.cs:line 85
       at TheraCall.NextGen.UI.UserControls.InformationBarControl..ctor() in F:\Projects\TheraCallNextGenNewSolution-3-30-branch\TheraCall.NextGen.UI\UserControl\InformationBarControl.cs:line 19
       at TheraCall.NextGen.UI.TheraMainForm.InitializeComponent() in F:\Projects\TheraCallNextGenNewSolution-3-30-branch\TheraCall.NextGen.UI\TheraMainForm.Designer.cs:line 116
       at TheraCall.NextGen.UI.TheraMainForm..ctor() in F:\Projects\TheraCallNextGenNewSolution-3-30-branch\TheraCall.NextGen.UI\TheraMainForm.cs:line 65
       at TheraCall.NextGen.UI.confidentialform.btnAccept_Click(Object sender, EventArgs e) in F:\Projects\TheraCallNextGenNewSolution-3-30-branch\TheraCall.NextGen.UI\Confidentialform.cs:line 17
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at Telerik.WinControls.RadControl.OnClick(EventArgs e)
       at Telerik.WinControls.UI.RadButtonBase.ButtonElement_Click(Object sender, EventArgs e)
       at Telerik.WinControls.RadItem.OnClick(EventArgs e)
       at Telerik.WinControls.UI.RadButtonItem.OnClick(EventArgs e)
       at Telerik.WinControls.RadItem.DoClick(EventArgs e)
       at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
       at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
       at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
       at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
       at Telerik.WinControls.RadElement.DoMouseUp(MouseEventArgs e)
       at Telerik.WinControls.RadElement.CallDoMouseUp(MouseEventArgs e)
       at Telerik.WinControls.ComponentInputBehavior.OnMouseUp(MouseEventArgs e)
       at Telerik.WinControls.RadControl.OnMouseUp(MouseEventArgs e)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at Telerik.WinControls.RadControl.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    Now, if i change the value 00:00:00.0000100 to 00:00:00.1000100, everything works fine. But, after every time I make some change in deign of parent user control, the value gets restored with its default value and exception continues to happen.

    I think it is the enough info for you to track the route cause. Please let me know if you need anything else.
  5. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 28 Mar 2012 Link to this post

    Hi Pawan,

    Thank you for these details. However, we are still not able to reproduce the issue. Please, note that in Q2 2011 the RadRichTextBox control is marked as Beta. That is why I recommend that you try our latest release - Q1 2012 SP1. If the issue continues to appear, please send us your project so we can investigate the issue further. Thank you in advance.

    I am looking forward to your reply.
     
    All the best,
    Jack
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
  6. Pawan
    Pawan avatar
    7 posts
    Member since:
    Mar 2012

    Posted 26 Apr 2012 Link to this post

    Resolved.

    The issue was caused by the design of our user control. The user control, was exposing the RadDocument of the Rich Text Box via a property. So, when you refresh the designer of the host form, all the properties for the RadDocument object refreshed and the property DocumentContentChangedInterval of RadDocument object gets reinitialized with default value every time.
    I eliminated the RadDocument type property and exposed it through a public methods.

    Jack, Thanks for your valuable support.

    --
    Pawan
  7. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 30 Apr 2012 Link to this post

    Hello Pawan,

    I am glad to hear that you have found the source of this issue. In case you have other questions do not hesitate to contact me.

    Greetings,
    Jack
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Back to Top
UI for WinForms is Visual Studio 2017 Ready