Telerik Forums
UI for WPF Forum
9 answers
208 views

We are using Telerik WPF controls Version 2015.3.1104.45
In our application, RadRichTexbox is used to create templates.
For a particular template, when we try to replace a table in RadRichTextBox from table in word by following these steps, radrichtextbox crashes our whole application

Steps:
* copy table from word document
* select table in RadRichTexbox by highlighting it
* Paste either by CTRL+V or by using right click context menu
* Application will crash

Detailed Exception StackTrace:

Object reference not set to an instance of an object.

Type: System.NullReferenceException:
Source:Telerik.Windows.Documents
Data: System.Object: 

Stack Trace:    at Telerik.Windows.Documents.Layout.DocumentLayoutBox.UpdateChildIndexesDownToParagraph(LayoutBox layoutBox, HashSet`1 documentLists) in D:\Work\MISC tasks\DMS template window crash\Telerik.Windows.Documents\Documents\Layout\DocumentLayoutBox.cs:line 169
   at Telerik.Windows.Documents.Layout.DocumentLayoutBox.UpdateChildIndexesDownToParagraph(LayoutBox layoutBox, HashSet`1 documentLists) in D:\Work\MISC tasks\DMS template window crash\Telerik.Windows.Documents\Documents\Layout\DocumentLayoutBox.cs:line 182
   at Telerik.Windows.Documents.Layout.DocumentLayoutBox.UpdateChildIndexesDownToParagraph(LayoutBox layoutBox, HashSet`1 documentLists) in D:\Work\MISC tasks\DMS template window crash\Telerik.Windows.Documents\Documents\Layout\DocumentLayoutBox.cs:line 182
   at Telerik.Windows.Documents.Layout.DocumentLayoutBox.UpdateParagraphInListSorting() in D:\Work\MISC tasks\DMS template window crash\Telerik.Windows.Documents\Documents\Layout\DocumentLayoutBox.cs:line 157
   at Telerik.Windows.Documents.Layout.DocumentLayoutBox.MeasureOverrideInternal(SizeF availableSize) in D:\Work\MISC tasks\DMS template window crash\Telerik.Windows.Documents\Documents\Layout\DocumentLayoutBox.cs:line 129
   at Telerik.Windows.Documents.Layout.DocumentLayoutBox.MeasureOverride(SizeF availableSize) in D:\Work\MISC tasks\DMS template window crash\Telerik.Windows.Documents\Documents\Layout\DocumentLayoutBox.cs:line 117
   at Telerik.Windows.Documents.Layout.LayoutElement.MeasureCore(SizeF availableSize) in D:\Work\MISC tasks\DMS template window crash\Telerik.Windows.Documents\Documents\Layout\LayoutElement.cs:line 711
   at Telerik.Windows.Documents.Layout.LayoutElement.Measure(SizeF availableSize) in D:\Work\MISC tasks\DMS template window crash\Telerik.Windows.Documents\Documents\Layout\LayoutElement.cs:line 640
   at Telerik.Windows.Documents.Model.RadDocument.Measure(SizeF measureSize) in D:\Work\MISC tasks\DMS template window crash\Telerik.Windows.Documents\Documents\Model\RadDocument.cs:line 1447
   at Telerik.Windows.Documents.UI.DocumentPrintLayoutPresenter.MeasureOverride(Size availableSize) in D:\Work\MISC tasks\DMS template window crash\Telerik.Windows.Documents\Documents\UI\DocumentPrintLayoutPresenter.cs:line 476
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

   
I have tried to resolve this by cancelling PasteCommand and writing my own logic in CommandExecuting Event

void radRichTextBox_CommandExecuting(object sender, CommandExecutingEventArgs e)
{
    if (e.Command is PasteCommand)
    {
        e.Cancel = true;
        try
        {
            this.txtMsgBody.Editor.Paste(); // this will throw exception in above mentioned test case
        }
        catch(Exception)
        {
            //Even this blank catch is not preventing application from crashing
        }
    }
}
 
void radRichTextBox_CommandError(object sender, CommandErrorEventArgs e)
{
    e.Handled = true;     //e.Handled = true is not stopping exception propogation
    //TODO: add logging
}

I have also debugged this crash by generating symbols using DotPeek and found that many internal different exceptions are also occurring due to which regardless of the catch in the radRichTextBox_CommandExecuting the application crashed.
Screen shots of which are attached

Please provide a workaround or solution for this issue. Moreover, it would be helpful if you can suggest that upgrading the version will fix this. Thanks.

Note: Our application is in production so upgrade will only be the last resort for us. 

Tanya
Telerik team
 answered on 08 Jan 2019
1 answer
77 views
Hi,

I'm using the RadGridView with option IsFilteringAllowed to auto generate the column filters. In almost case it work perfect, but in some case filter value items show in blank and unable to select as the attached image. Have anyone face with that problem, reproduce the error and got the solution for that?

Thanks,
Tri Nguyen
Tri
Top achievements
Rank 1
 answered on 08 Jan 2019
3 answers
147 views

Hi,

 

How can I change the default blue color on the bars in the outlook template?

Vladimir Stoyanov
Telerik team
 answered on 07 Jan 2019
3 answers
453 views
Even with the markup below, my object source is updated only after losing the focus. It should be during the checking and unchecking. Is there something wrong here?

<telerik:GridViewCheckBoxColumn Header="Accepted" MinWidth="75" MaxWidth="75" 
                          DataMemberBinding="{Binding IsAccepted, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                          AutoSelectOnEdit="True" EditTriggers="CellClick"/>
Dilyan Traykov
Telerik team
 answered on 07 Jan 2019
1 answer
89 views

While saving the filter descriptors of the gridview (i.e. serializing the gridview to an xml using the PersistentManager.Save(radgridview)), the persistent manager is unable to save the value of the distinct filter value of type DateTimeOffset. 

Here is the part of xml serialization of the SelectedDistinctValues of FilterDescriptors with type DateTimeOffset on radgridview.

 <PV Key="254" TypeKey="-933998283">     

<Value xsi:type="DateTimeOffset" />   

</PV> 

which should Ideally be as follows:

 <PV Key="254" TypeKey="-933998283">     
<Value xsi:type="DateTimeOffset"> 12/8/2018 11:25:59 AM +00:00 </Value>   
</PV> 

This issue is observed on 2017.2.614.45 version.

Can you please provide your insights and resolve this issue?

Martin Ivanov
Telerik team
 answered on 07 Jan 2019
2 answers
146 views

I'm using UI for WPF 2018.3.1016.

In the Crystal theme, the RadPasswordBox.IsTabStop property defaults to False.  This is different than in the other themes I've tried (Material, Expression_Dark), where it defaults to True.

In the Material theme, the RadPasswordBox's watermark foreground is different than the color of the RadWatermarkTextBox's.  It's obvious when you have both controls visible in the same UI, such as in a login form.

Thx,
Pat

 

Patrick
Top achievements
Rank 1
 answered on 05 Jan 2019
2 answers
124 views

Hi,

I'm running into this problem: I have a Wizard with some pages. If I place these pages directly into the Wizard in XAML, everything works well. However, as I wanted to manage the pages in a cleaner manner, I created and designed each page like a UserControl - I create a UserControl, change its base class to telerik:WizardPage, and design the page in it. Unfortunately pages created this way does not show in the Wizard.

Is this a bug or by design? What's the best practice to manage a Wizard with many pages, with each of which has its own complex logic?

Hillin
Top achievements
Rank 1
 answered on 05 Jan 2019
7 answers
127 views

When I open WPF designer to preview design I always have exception "InvalidOperationException: 'RadComboBox' TargetType does not match type of element 'NumberComboBox'."

I think, we have problem with controls in the Properties window.

Dinko | Tech Support Engineer
Telerik team
 answered on 04 Jan 2019
0 answers
149 views

Hi,

I know importing HTML does not support inserting merge fields automaticaly but in simple loop we can do it in code.

As you can see, we selecting text like {MERGEFIELD NAME} and inserting new merge field. It is working fine, and highlight fields or preview results works correct. The only problem is, when I set some styles in text before merge field, save html and then loads it again, mergefield is going to inherit these styles. This situation is illustrated on screenshots. I set color for second line, then after my InsertMergeFields method inserts all fields, the second line has style from first line, and the third line has styles from second.

It looks like a default behavior from document editors, when caret is placed after red text, next letter will be also red, but can I do something with this?

 

public static void InsertMergeFields(RadDocument radDocument)
       {
           foreach (var mergeField in new DocumentTextSearch(radDocument).FindAll("{MERGEFIELD.*?}"))
           {
               mergeField.SetSelection(radDocument);
               var fieldCode = GetFieldCode(radDocument.Selection.GetSelectedText());
               radDocument.InsertField(new MergeField() { PropertyPath = fieldCode }, FieldDisplayMode.Code);
           }
       }
Jakub
Top achievements
Rank 1
Iron
 asked on 03 Jan 2019
0 answers
109 views

Hi, 

I am using RichTextBox in LayoutMode="Flow" and Padding="10". It is working when writing new content, but one of application user copied some content from another editor (maybe MSWord, I dont know) and the padding is gone. Well, it looks like a padding but when exporting this document to xaml or html, the Indent property for this spans is -97.005. Can I prevent from this situation? 

 

As you can see on screenshots, the Indent is set to minus value and richtextbox even when padding is set to 10 does not take this into account.

Jakub
Top achievements
Rank 1
Iron
 asked on 03 Jan 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?